Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Plug-in dependencies
Plug-in dependencies [message #231061] Mon, 19 April 2004 09:34 Go to next message
Eclipse UserFriend
Originally posted by: public.soft-gems.net

Hi all,

Currently I have a problem, which I cannot solve on my own, although I
tried many times. What I have is a plug-in project and a library project
in Eclipse. The library project contains a few classes to manipulate XML
data. The plug-in uses these classes and compiles fine so far after I
checked the lib project in "Properties -> Java Build Path -> Projects ->
Required projects on the build path". Now I start my runtime workbench and
try also to launch the plug in. This fails with the infamous
"java.lang.NoClassDefFoundError: ../.../xml/XMLModel" so I assume the XML
classes cannot be found.

Please, what exactly am I missing to make these classes known to the
workbench? I tried to add the lib to the runtime-libraries of the plug-in,
added a class folder to Libraries in the Java Build Path settings and
checked the right entries in the "Order and Export" settings. Nothing
helped and I'm now really stuck.

Can someone help me please?

Mike
--
www.soft-gems.net
Re: Plug-in dependencies [message #231083 is a reply to message #231061] Mon, 19 April 2004 10:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

For plugins you don't use the java build path. You use the plugin.xml.
This is plugins at runtime can only access jars that are defined in
their plugin.xml (under the <libraries> entry), or in exported libraries
from required plugins.

So you need to update your plugin.xml to have a <library> stmt pointing
to the appropriate jar AND that jar must be in the plugin's directory or
subdirectory of it.

For plugin development please see:

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

and for general information on the concept of plugins see:

http://www.eclipse.org/articles/Article-Plug-in-architecture /plugin_architecture.html

This will answer many of the questions about plugins.
--
Thanks, Rich Kulp

Re: Plug-in dependencies [message #231515 is a reply to message #231083] Tue, 20 April 2004 02:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: public.soft-gems.net

Rich Kulp wrote:

> For plugins you don't use the java build path. You use the plugin.xml.
> This is plugins at runtime can only access jars that are defined in
> their plugin.xml (under the <libraries> entry), or in exported libraries
> from required plugins.

> So you need to update your plugin.xml to have a <library> stmt pointing
> to the appropriate jar AND that jar must be in the plugin's directory or
> subdirectory of it.

Thank you very much for your help, Rich. What I don't understand, though,
is why I have to specify the jar files in the runtime libraries. I mean,
by default there is no jar file for my plug-in, although its name is
specified in this section. And still when I launch the runtime workbench
the plug-in works just fine. So I'd say, the jar is not really needed, nor
created at all during development.

The need of having a jar file for the other library produces other
problems, like the need to rebuild this jar every time I change something
in the library. This is very ineffective and not well understandable. I
can specify a lot of things, which are to be exported or describe
dependencies between projects, so the main project knows everything
needed. But for the plug-in I have set up an automatic build process to
have the updated jar available (because handling this manually is simply
unacceptable), which complicates matters, particularly for beginners like
me.

Can you tell me what the meaning of required projects settings for the
Java build path is when it is not used actually? It does not look very
consistent to me when settings for my plug-in are spread over the normal
property settings and the plugin.xml. You also *must* set certain things
in both places to make the plug-in work finally.

Anyway, I think I've again learned something useful.

Thank you,

Mike
--
www.soft-gems.net
Re: Plug-in dependencies [message #231700 is a reply to message #231515] Tue, 20 April 2004 10:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

It is the way it is for plugins. Plugins are meant to be distributed
self-contained units. They can't point to anything outside because
depending on who it is distributed to, the outside stuff might not be
there. It can only depend on other plugins.

I don't understand what you mean by you don't have a jar file. Does your
plugin do anything? It needs code to do something, and the jar file(s)
are the code for the plugin. If you mean at development time that there
is no jar, that is correct. The PDE takes care of this when you do
launch runtime workbench. It fixes up the plugins classpath to use the
bin output directory of your plugin project instead of the jar. However,
when you distribute your plugin to run outside of development, you need
to have a jar then. The Export Deployable Plugins wizard takes care of
creating this jar for The first link I gave you explains all of this.

As for the java build path, that is maintained by the updating the
plugin.xml and build.properties files, typically. You don't specify
required projects when working with plugins because the PDE takes of
that, you don't need to. You would use required projects only for
NON_PLUGIN projects.


--
Thanks, Rich Kulp

Re: Plug-in dependencies [message #231773 is a reply to message #231700] Tue, 20 April 2004 11:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: public.lischke-online.de

Rich Kulp wrote

>You would use required projects only for NON_PLUGIN projects.

Thank you for your patience. I think the whole issue is not yet finally
solved. I made my plug-in work but copying jar files around every time you
change something is not a good solution.

Mike
--
www.soft-gems.net
Re: Plug-in dependencies [message #231830 is a reply to message #231773] Tue, 20 April 2004 12:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

You should not need to copy jars files around in development mode. In
development mode you have source code in your plugin projects. Then when
you export your plugin this source code is compiled into jars.

Could you please give an example of what jars you are moving around.

Mike Lischke wrote:

> Rich Kulp wrote
>
>> You would use required projects only for NON_PLUGIN projects.
>
>
> Thank you for your patience. I think the whole issue is not yet finally
> solved. I made my plug-in work but copying jar files around every time
> you change something is not a good solution.
>
> Mike

--
Thanks, Rich Kulp

Re: Plug-in dependencies [message #231847 is a reply to message #231830] Tue, 20 April 2004 12:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: public.lischke-online.de

Rich Kulp wrote

>You should not need to copy jars files around in development mode. In
development mode you have source code in your plugin projects.

That's what I was asking about initially.

>Then when you export your plugin this source code is compiled into jars.

Currently I rexport my lib jar every time to my plug-in folder.

>Could you please give an example of what jars you are moving around.

The situation is as I wrote originally. I have a workspace with 2
projects. One is the plug-in the other one is the library on which the
plug-in depends. The library is a collection of java files plus another
jar (jdom). When I launch a runtime workbench my plug-in starts but as
soon as I access something in the library project I get the
class-not-found exception. I tried your tips and a lot of other
combinations and manual changes, but nothing help until I exported the lib
as jar and copied it into the plug-in folder.

Mike
--
www.soft-gems.net
Re: Plug-in dependencies [message #231879 is a reply to message #231847] Tue, 20 April 2004 13:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

The other jar needs to be a library jar within a plugin, either the same
plugin or a different plugin that your first plugin requires. It is the
ONLY way that it can work. Jars must be libraries within a plugin.xml
and must be located within that plugin. The other jar cannot be in some
other non-plugin project at all.

If you do that then the PDE can handle it and will use the bin output
folders when launching for development. And then when exported as a
plugin then it will build the jars for you.

Mike Lischke wrote:

> Rich Kulp wrote
>
>> You should not need to copy jars files around in development mode. In
>
> development mode you have source code in your plugin projects.
>
> That's what I was asking about initially.
>
>> Then when you export your plugin this source code is compiled into jars.
>
>
> Currently I rexport my lib jar every time to my plug-in folder.
>
>> Could you please give an example of what jars you are moving around.
>
>
> The situation is as I wrote originally. I have a workspace with 2
> projects. One is the plug-in the other one is the library on which the
> plug-in depends. The library is a collection of java files plus another
> jar (jdom). When I launch a runtime workbench my plug-in starts but as
> soon as I access something in the library project I get the
> class-not-found exception. I tried your tips and a lot of other
> combinations and manual changes, but nothing help until I exported the
> lib as jar and copied it into the plug-in folder.
>
> Mike

--
Thanks, Rich Kulp

Re: Plug-in dependencies [message #232095 is a reply to message #231879] Wed, 21 April 2004 01:37 Go to previous message
Eclipse UserFriend
Originally posted by: public.soft-gems.net

Rich Kulp wrote:

> If you do that then the PDE can handle it and will use the bin output
> folders when launching for development. And then when exported as a
> plugin then it will build the jars for you.

Again, thanks for your patience.

Mike
--
www.soft-gems.net
Previous Topic:Combining two similar but different input to editor
Next Topic:Sick of Save Error
Goto Forum:
  


Current Time: Sun Nov 09 04:17:50 EST 2025

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

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

Back to the top