Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » ClassNotFoundError
ClassNotFoundError [message #246278] Tue, 22 January 2008 10:11 Go to next message
Eclipse UserFriend
Originally posted by: himabindu.chamarthy.gmail.com

Hi,

I am using Eclipse 3.2. I am facing trouble resolving dependencies on an
external plug-in that my plug-in project requires.

I have a plug-in project which is dependent on a jar, say jar X. This jar
is not directly available but is present in another plug-in, say Plug-in
A. When I put plug-in A in my build path, I cannot compile my code
successfully as the symbols used in my project from Jar X are not
successfully resolved. So When I extract Jar X from Plug-in A and put it
in my build path, the code is successfully compiled but i get a
ClassNotFoundError for one of the classes from Jar X during runtime. I
even tried putting Plug-in A as a required-bundle in my manifest file, but
without success.

How do I solve this? How do I make the jars within the external plug-in be
recognised during build as well as during runtime?
Re: ClassNotFoundError [message #246291 is a reply to message #246278] Tue, 22 January 2008 11:17 Go to previous messageGo to next message
kiril mitov is currently offline kiril mitovFriend
Messages: 69
Registered: July 2009
Member
Hi Hima,

1. I suppose you HAVE WRITE access to the external plugin.
Open the MANIFEST.MF file of the external plugin. Go to the Runtime Tab.
Look at the Classpath section.
In this section you should describe the jars that are part of your plugin
class path. This jars will be part of your runtime. Click on the Add..
button and add the desired jar.
After that Look at the Exported Packages section. Click on Add... and select
those packages of the jar that you would like to be seen in the runtime.

2. I suppose you do NOT HAVE WRITE access to the external plugin.
Since the jar is used, but it is not exported by the external plugin i don`t
think you can use this jar through the external plugin.
I am not sure how to achieve this.
Is this your case?

Best Regards,
Kiril

"hima" <himabindu.chamarthy@gmail.com> wrote in message
news:13c9fe29e9da03b62a80917e6f2e75d2$1@www.eclipse.org...
> Hi,
>
> I am using Eclipse 3.2. I am facing trouble resolving dependencies on an
> external plug-in that my plug-in project requires.
>
> I have a plug-in project which is dependent on a jar, say jar X. This jar
> is not directly available but is present in another plug-in, say Plug-in
> A. When I put plug-in A in my build path, I cannot compile my code
> successfully as the symbols used in my project from Jar X are not
> successfully resolved. So When I extract Jar X from Plug-in A and put it
> in my build path, the code is successfully compiled but i get a
> ClassNotFoundError for one of the classes from Jar X during runtime. I
> even tried putting Plug-in A as a required-bundle in my manifest file, but
> without success.
>
> How do I solve this? How do I make the jars within the external plug-in be
> recognised during build as well as during runtime?
>
Re: ClassNotFoundError [message #246295 is a reply to message #246278] Tue, 22 January 2008 11:19 Go to previous message
Eclipse UserFriend
Originally posted by: al_PUBLIC.gmx.de

On Tue, 22 Jan 2008 10:11:00 +0000 (UTC),
himabindu.chamarthy@gmail.com (hima) wrote:

>Hi,
>
>I am using Eclipse 3.2. I am facing trouble resolving dependencies on an
>external plug-in that my plug-in project requires.
>
>I have a plug-in project which is dependent on a jar, say jar X. This jar
>is not directly available but is present in another plug-in, say Plug-in
>A. When I put plug-in A in my build path, I cannot compile my code
>successfully as the symbols used in my project from Jar X are not
>successfully resolved. So When I extract Jar X from Plug-in A and put it
>in my build path, the code is successfully compiled but i get a
>ClassNotFoundError for one of the classes from Jar X during runtime.

You have to specify your X.jar as a runtime dependency in your
plugin.xml or manifest file. This can be done with the plugin.xml
editor on the "Runtime" tab inside the "Classpath" list.

I
>even tried putting Plug-in A as a required-bundle in my manifest file, but
>without success.

This would be possible if plug-in A was set to reexport the X.jar
(which is mostly a bad idea because you may end up in .jar version
hell).

>
>How do I solve this? How do I make the jars within the external plug-in be
>recognised during build as well as during runtime?

Add the X.jar to your plug-ins lib directory, add it to the classpath
in your plugin description and you're set. If you have a launch
configuration in the IDE you may have to check if the dependency is
correctly resolved (should be done internal by Eclipse).


Achim
Previous Topic:Custom view interacting with editor
Next Topic:Cannot find external jars in my jar file
Goto Forum:
  


Current Time: Thu Sep 26 04:58:15 GMT 2024

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

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

Back to the top