Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Set Runtime-Classpath (LaunchConfiguration) programmatically
Set Runtime-Classpath (LaunchConfiguration) programmatically [message #285187] Wed, 11 May 2005 10:33 Go to next message
Przemyslaw Doe is currently offline Przemyslaw DoeFriend
Messages: 49
Registered: July 2009
Member
Hallo,
myPlugin sets for certain javaprojects a nature (extends from
IProjectNature). Now I want to add new runtime-classpath for every
launchconfiguration for this projects. (I want do this programmatically
inside my plugin when I set the nature...).

First I tried the Extension:
Code:

<extension
point="org.eclipse.jdt.launching.runtimeClasspathEntries">
<runtimeClasspathEntry
class="MyPathEntry"
id="MyPathEntryID">
</runtimeClasspathEntry>
</extension>


but it did not work.

Then I tried the Extension:
Code:

<extension
point="org.eclipse.jdt.launching.classpathProviders">
<classpathProvider
class="MyClasspathProvider"
id="MyClasspathProviderID">
</classpathProvider>
</extension>


but my class MyClasspathProvider is never executed.

Even if I walk through all launchconfigurations when i set my nature:
Code:

ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfiguration[] lcs = manager.getLaunchConfigurations();
for (int i = 0; i < lcs.length; i++) {
ILaunchConfiguration configuration = lcs[i];
ILaunchConfigurationWorkingCopy wc =
configuration.getWorkingCopy();
if(wc.getAttribute("org.eclipse.debug.ui.private", false)) {
continue;
}
wc.setAttribute("ATTR_CLASSPATH_PROVIDER",
"MyClasspathProviderID");
wc.doSave();

}


and I set the attribute "ATTR_CLASSPATH_PROVIDER" with my provider id
"MyClasspathProviderID", like described in the documentation of this
Extension-Point nothing happens...

What do I wrong?
Can someone help me, please?

--
Przemyslaw Dul
Przemek_d@gmx.de
Re: Set Runtime-Classpath (LaunchConfiguration) programmatically [message #285257 is a reply to message #285187] Thu, 12 May 2005 20:52 Go to previous messageGo to next message
Darin Wright is currently offline Darin WrightFriend
Messages: 454
Registered: July 2009
Senior Member
Your classpath provider will be asked to compute an unresolved classpath for
your launch configs when they are launched, and to resolve the classpath
they compute. See JavaRuntime.computeUnresolvedRuntimeClasspath(...).

Darin

"Przemyslaw" <Przemek_d@gmx.de> wrote in message
news:d5snji$qmp$1@news.eclipse.org...
> Hallo,
> myPlugin sets for certain javaprojects a nature (extends from
> IProjectNature). Now I want to add new runtime-classpath for every
> launchconfiguration for this projects. (I want do this programmatically
> inside my plugin when I set the nature...).
>
> First I tried the Extension:
> Code:
>
> <extension
> point="org.eclipse.jdt.launching.runtimeClasspathEntries">
> <runtimeClasspathEntry
> class="MyPathEntry"
> id="MyPathEntryID">
> </runtimeClasspathEntry>
> </extension>
>
>
> but it did not work.
>
> Then I tried the Extension:
> Code:
>
> <extension
> point="org.eclipse.jdt.launching.classpathProviders">
> <classpathProvider
> class="MyClasspathProvider"
> id="MyClasspathProviderID">
> </classpathProvider>
> </extension>
>
>
> but my class MyClasspathProvider is never executed.
>
> Even if I walk through all launchconfigurations when i set my nature:
> Code:
>
> ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
> ILaunchConfiguration[] lcs = manager.getLaunchConfigurations();
> for (int i = 0; i < lcs.length; i++) {
> ILaunchConfiguration configuration = lcs[i];
> ILaunchConfigurationWorkingCopy wc =
> configuration.getWorkingCopy();
> if(wc.getAttribute("org.eclipse.debug.ui.private", false)) {
> continue;
> }
> wc.setAttribute("ATTR_CLASSPATH_PROVIDER",
> "MyClasspathProviderID");
> wc.doSave();
>
> }
>
>
> and I set the attribute "ATTR_CLASSPATH_PROVIDER" with my provider id
> "MyClasspathProviderID", like described in the documentation of this
> Extension-Point nothing happens...
>
> What do I wrong?
> Can someone help me, please?
>
> --
> Przemyslaw Dul
> Przemek_d@gmx.de
>
>
Re: Set Runtime-Classpath (LaunchConfiguration) programmatically [message #285291 is a reply to message #285257] Sat, 14 May 2005 00:48 Go to previous messageGo to next message
Przemyslaw Doe is currently offline Przemyslaw DoeFriend
Messages: 49
Registered: July 2009
Member
Thanks,
since I use IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER
instead of "ATTR_CLASSPATH_PROVIDER", it works...of course.
bye

"Darin Wright" <Darin_Wright@ca.ibm.com> schrieb im Newsbeitrag
news:d60gb9$82c$1@news.eclipse.org...
> Your classpath provider will be asked to compute an unresolved classpath
> for your launch configs when they are launched, and to resolve the
> classpath they compute. See
> JavaRuntime.computeUnresolvedRuntimeClasspath(...).
>
> Darin
>
> "Przemyslaw" <Przemek_d@gmx.de> wrote in message
> news:d5snji$qmp$1@news.eclipse.org...
>> Hallo,
>> myPlugin sets for certain javaprojects a nature (extends from
>> IProjectNature). Now I want to add new runtime-classpath for every
>> launchconfiguration for this projects. (I want do this programmatically
>> inside my plugin when I set the nature...).
>>
>> First I tried the Extension:
>> Code:
>>
>> <extension
>> point="org.eclipse.jdt.launching.runtimeClasspathEntries">
>> <runtimeClasspathEntry
>> class="MyPathEntry"
>> id="MyPathEntryID">
>> </runtimeClasspathEntry>
>> </extension>
>>
>>
>> but it did not work.
>>
>> Then I tried the Extension:
>> Code:
>>
>> <extension
>> point="org.eclipse.jdt.launching.classpathProviders">
>> <classpathProvider
>> class="MyClasspathProvider"
>> id="MyClasspathProviderID">
>> </classpathProvider>
>> </extension>
>>
>>
>> but my class MyClasspathProvider is never executed.
>>
>> Even if I walk through all launchconfigurations when i set my nature:
>> Code:
>>
>> ILaunchManager manager =
>> DebugPlugin.getDefault().getLaunchManager();
>> ILaunchConfiguration[] lcs =
>> manager.getLaunchConfigurations();
>> for (int i = 0; i < lcs.length; i++) {
>> ILaunchConfiguration configuration = lcs[i];
>> ILaunchConfigurationWorkingCopy wc =
>> configuration.getWorkingCopy();
>> if(wc.getAttribute("org.eclipse.debug.ui.private", false))
>> {
>> continue;
>> }
>> wc.setAttribute("ATTR_CLASSPATH_PROVIDER",
>> "MyClasspathProviderID");
>> wc.doSave();
>>
>> }
>>
>>
>> and I set the attribute "ATTR_CLASSPATH_PROVIDER" with my provider id
>> "MyClasspathProviderID", like described in the documentation of this
>> Extension-Point nothing happens...
>>
>> What do I wrong?
>> Can someone help me, please?
>>
>> --
>> Przemyslaw Dul
>> Przemek_d@gmx.de
>>
>>
>
>
Re: Set Runtime-Classpath (LaunchConfiguration) programmatically [message #1781325 is a reply to message #285291] Tue, 06 February 2018 06:08 Go to previous message
Jash Dave is currently offline Jash DaveFriend
Messages: 2
Registered: February 2018
Junior Member
I also want to do the same "myPlugin sets for certain javaprojects a nature (extends from IProjectNature). Now I want to add new runtime-classpath for every launchconfiguration for this projects. (I want do this programmatically inside my plugin when I set the nature...)."

But I could not fined details on org.eclipse.jdt.launching.classpathProviders i.e. how to implement MyClasspathProvider and what to return for computeUnresolvedClasspath() and resolveClasspath() methods? Can someone provide me with explanation of these methods?

Thank you.
Previous Topic:License management for Eclipse based products
Next Topic:Java Virtual machine error
Goto Forum:
  


Current Time: Sat Sep 22 11:15:11 GMT 2018

Powered by FUDForum. Page generated in 0.02361 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top