Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » External JAR, NoClassDefFoundError
External JAR, NoClassDefFoundError [message #325850] Thu, 28 February 2008 17:13 Go to next message
Eclipse UserFriend
Originally posted by: andy.auyeung.3ds.com

I have an external jar that I use in my Plug-in project. I added the jar
from "Config class path/Libraries/Add External JARs". The compile errors
went away after that.

However, when I test launch the Plug-in, I ran into an error. Those
classes in the external jar gave me NoClassDefFoundError.

Anyone knows the solution ?
Re: External JAR, NoClassDefFoundError [message #325860 is a reply to message #325850] Fri, 29 February 2008 06:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------020208080804000502030305
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Andy,

This is a classic mistake when developing plugins (and something that
the tools should either prevent or warn you about). At runtime, the
information in the MANIFEST.MF is used to find jars. That's also what's
used a development time to indirectly determine the classpath of the
project. But if you directly modify the properties of the project to
configure the classpath, you'll find the same problem comes back at
runtime. So when developing plugins, *always *use the Dependencies
tab of the MANIFEST.MF editor to fix classpath problems. Use the popup
PDE Tools->Update classpath if the changes to the MANIFEST.MF don't seem
to kick in; if you do this before making any changes there, you should
see your compilation error come back and that will help you verify
you've fixed that properly via changes to the dependencies.


Andy wrote:
> I have an external jar that I use in my Plug-in project. I added the
> jar from "Config class path/Libraries/Add External JARs". The compile
> errors went away after that.
>
> However, when I test launch the Plug-in, I ran into an error. Those
> classes in the external jar gave me NoClassDefFoundError.
> Anyone knows the solution ?


--------------020208080804000502030305
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Andy,<br>
<br>
This is a classic mistake when developing plugins (and something that
the tools should either prevent or warn you about). At runtime, the
information in the MANIFEST.MF is used to find jars.
Re: External JAR, NoClassDefFoundError [message #325877 is a reply to message #325860] Fri, 29 February 2008 09:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andy.auyeung.3ds.com

I am at the Dependencies page, but still a bit unclear where to add my.jar
to the classpath. Is it "Imported Packages" ? I don't seem to find the
right place here. Please help.
Re: External JAR, NoClassDefFoundError [message #325878 is a reply to message #325877] Fri, 29 February 2008 09:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Andy,

I'd assumed the jar was another plugin. If it's a jar in your plugin,
you'd use the Runtime tab's Classpath section to add it to the plugin's
classpath.


Andy wrote:
> I am at the Dependencies page, but still a bit unclear where to add
> my.jar to the classpath. Is it "Imported Packages" ? I don't seem to
> find the right place here. Please help.
>
Re: External JAR, NoClassDefFoundError [message #325882 is a reply to message #325860] Fri, 29 February 2008 11:15 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Ed Merks wrote:
> Andy,
>
> This is a classic mistake when developing plugins (and something that
> the tools should either prevent or warn you about). At runtime, the
> information in the MANIFEST.MF is used to find jars. That's also what's
> used a development time to indirectly determine the classpath of the
> project. But if you directly modify the properties of the project to
> configure the classpath, you'll find the same problem comes back at
> runtime. So when developing plugins, *always *use the Dependencies
> tab of the MANIFEST.MF editor to fix classpath problems. Use the popup
> PDE Tools->Update classpath if the changes to the MANIFEST.MF don't seem
> to kick in; if you do this before making any changes there, you should
> see your compilation error come back and that will help you verify
> you've fixed that properly via changes to the dependencies.

There is a Bugzilla about this somewhere, but I can't seem to find it now.


>
>
> Andy wrote:
>> I have an external jar that I use in my Plug-in project. I added the
>> jar from "Config class path/Libraries/Add External JARs". The compile
>> errors went away after that.
>>
>> However, when I test launch the Plug-in, I ran into an error. Those
>> classes in the external jar gave me NoClassDefFoundError.
>> Anyone knows the solution ?
>
Previous Topic:How to contribute to Eclipse's Properties view?
Next Topic:Wizard Dialog as a View
Goto Forum:
  


Current Time: Tue May 06 15:41:45 EDT 2025

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

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

Back to the top