| Plug-in dependencies [message #231061] |
Mon, 19 April 2004 09:34  |
Eclipse User |
|
|
|
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 #231515 is a reply to message #231083] |
Tue, 20 April 2004 02:50   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #232095 is a reply to message #231879] |
Wed, 21 April 2004 01:37  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03617 seconds