Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Classpath setting in Runtime project
Classpath setting in Runtime project [message #115960] Tue, 11 November 2003 23:00 Go to next message
Eclipse UserFriend
Originally posted by: hrjobs000.sympatico.ca

Hello,

How can I set up a classpath for the project in Runtime environment (for
2.1.2) that reference the plugin itself? If I use
JavaCore.newVariableEntry(new
Path("ECLIPSE_HOME/plugins/my.plugin/plugin.jar")) it is obvious that this
JAR is not yet exist. This could work with properly deployed plugin. But
what should I do for the Run-time?

Sorry if this one is FAQ...

Thanks,
Alex.
Re: Classpath setting in Runtime project [message #116114 is a reply to message #115960] Wed, 12 November 2003 10:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

See for developing plugins within Eclipse itself:

http://www.eclipse.org/articles/Article-PDE-does-plugins/PDE -intro.html


--
Thanks, Rich Kulp

Re: Classpath setting in Runtime project [message #116150 is a reply to message #116114] Wed, 12 November 2003 11:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexsmr.sympatico.ca

Rich,

The article doesn't answer my question.

I'll elaborate on my problem. I develop plugin that create a JavaProject.
I want automatically set correct classpath to the plugin itself during
new project creation process. So in the case when I properly
deployed my plugin into ECLIPSE_HOME/plugins I can use something
like JavaCore.newVariableEntry to create correspondent Classpath entry.

But the question is what should I use in RunTime? I need to access the
classes from my plugin from the runtime environment... Is there unique
way to resolve this classpath for both deployed and runtime plugin?

Thanks,
Alex.

>"Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
news:botii8$ell$2@eclipse.org...
>See for developing plugins within Eclipse itself:
>
> http://www.eclipse.org/articles/Article-PDE-does-plugins/PDE -intro.html
>
>
>--
>Thanks, Rich Kulp
Re: Classpath setting in Runtime project [message #116200 is a reply to message #116150] Wed, 12 November 2003 12:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Are you saying your plugin is creating a NON-PLUGIN java project. But
you want that project to have a jar that is stored somewhere in your
plugin's directory that is running in the IDE that is doing the creating
of the project?

I would suggest this:

1) Put in your classpath a special variable, you can call it "MYPLUGNPATH".

2) In your classpath entry you would use this variable and add the path
to your jar from your plugin root. (This way you can actually have more
than one jar in your plugin that can be added to the project).

3) In your plugin add in a ClasspathVariableInitializer. Look this
extension point and class up in the help->JDT Developer's
Guide->Reference->Extension Points.

4) Your implementation of the initializer will return the following path
for MYPLUGINPATH:
Platform.resolveURL(myplugin.getInstallURL()).getFile();

This will be the path (assuming your plugins is on the same system as
the workspace, which it is 99% of the time).

This way it will automatically adjust itself no matter where you plugin
is at. You won't have to hardcode it and if the project is shared in CVS
and brought down on someone else's workspace it will readjust itself to
the installation.


--
Thanks, Rich Kulp

Re: Classpath setting in Runtime project [message #116282 is a reply to message #116200] Wed, 12 November 2003 13:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexsmr.sympatico.ca

Thanks Rich,

That was the point.

Last thing... When dealing with JavaCore.newVariableEntry,
JDT expects it to point on JAR file. But in Runtime PDE classes
are loaded from "bin" directory from my plugin. How can I resolve
this? If I can't, then how can I tell the PDE to create the Jar file
automatically on each build? Adding "Ant builder" to the PDE project?

Thanks,
Alex.

"Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
news:botp7b$ntm$1@eclipse.org...
> Are you saying your plugin is creating a NON-PLUGIN java project. But
> you want that project to have a jar that is stored somewhere in your
> plugin's directory that is running in the IDE that is doing the creating
> of the project?
>
> I would suggest this:
>
> 1) Put in your classpath a special variable, you can call it
"MYPLUGNPATH".
>
> 2) In your classpath entry you would use this variable and add the path
> to your jar from your plugin root. (This way you can actually have more
> than one jar in your plugin that can be added to the project).
>
> 3) In your plugin add in a ClasspathVariableInitializer. Look this
> extension point and class up in the help->JDT Developer's
> Guide->Reference->Extension Points.
>
> 4) Your implementation of the initializer will return the following path
> for MYPLUGINPATH:
> Platform.resolveURL(myplugin.getInstallURL()).getFile();
>
> This will be the path (assuming your plugins is on the same system as
> the workspace, which it is 99% of the time).
>
> This way it will automatically adjust itself no matter where you plugin
> is at. You won't have to hardcode it and if the project is shared in CVS
> and brought down on someone else's workspace it will readjust itself to
> the installation.
>
>
> --
> Thanks, Rich Kulp
> 
>
Re: Classpath setting in Runtime project [message #116498 is a reply to message #116282] Wed, 12 November 2003 13:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

That's a good point. I tried to see if maybe it could understand that it
is a class folder instead, but it doesn't. Adding an ant builder might
be a good idea, but you'd need some way of knowing that it needs to be
re-jarred up. Otherwise it would jar it on every single build.

The only way otherwise would be to have a jardesc file and you
explicitly run it when you realize the jar needs to be rebuilt.


--
Thanks, Rich Kulp

Re: Classpath setting in Runtime project [message #116504 is a reply to message #116498] Wed, 12 November 2003 15:17 Go to previous message
Eclipse UserFriend
Originally posted by: alexsmr.sympatico.ca

Thanks Rich,

This could be quite usefull feature if the workbench could
resolve pointer to plugin's runtime library for both
developement and production.environment.

Alex.

"Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
news:botvi0$vp1$1@eclipse.org...
> That's a good point. I tried to see if maybe it could understand that it
> is a class folder instead, but it doesn't. Adding an ant builder might
> be a good idea, but you'd need some way of knowing that it needs to be
> re-jarred up. Otherwise it would jar it on every single build.
>
> The only way otherwise would be to have a jardesc file and you
> explicitly run it when you realize the jar needs to be rebuilt.
>
>
> --
> Thanks, Rich Kulp
> 
>
Previous Topic:how make "step with filters" the default
Next Topic:3.0 M4 unable to open files in linked source directories
Goto Forum:
  


Current Time: Sat Jul 19 02:32:28 EDT 2025

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

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

Back to the top