Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Set Runtime-Classpath (LaunchConfiguration) programmatically
Set Runtime-Classpath (LaunchConfiguration) programmatically [message #203088] Wed, 11 May 2005 06:56 Go to next message
Eclipse UserFriend
Hallo,
my Plugin 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
www.stud.uni-hannover.de/~pd
Re: Set Runtime-Classpath (LaunchConfiguration) programmatically [message #203104 is a reply to message #203088] Wed, 11 May 2005 10:14 Go to previous message
Eclipse UserFriend
Please see this article that describes some Java launching features to see
if it answers your questions:

http://www.eclipse.org/articles/Article-Java-launch/launchin g-java.html

Darin

"Przemyslaw" <Przemek_d@gmx.de> wrote in message
news:d5sot3$sbb$1@news.eclipse.org...
> Hallo,
> my Plugin 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
> www.stud.uni-hannover.de/~pd
>
Previous Topic:Classpath container hicups, or bug in 3.1M6?
Next Topic:extending the compiler to add an error
Goto Forum:
  


Current Time: Sun Jun 08 12:40:39 EDT 2025

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

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

Back to the top