Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » exporting jar files
exporting jar files [message #170924] Thu, 14 September 2006 00:48 Go to next message
Eclipse UserFriend
Originally posted by: ploy.valasciences.yahoo.com

Please forgive me if this is an extremely basic question that may have
been answered previously. I have been trying to find the answer to my
question for a couple of months now to no avail. I have searched the
newsgroups and can't find the answer to my question.

I have an application that I am working on that I inherited as part of my
job. I am new to Eclipse and to Java. The application runs perfect in
Eclipse. When I export to a jar file, it run fine until it tries to
access a class that is contained within an external jar file. I have
added this jar file in the Project Properties, I have included the path to
the jar file in the classpath variable... In short, I have done everything
I know to get this app to run without the error, which is the dreaded
NoClassDefFoundError.

I understand that this is probably a classpath error, but as I said
previously, I've tried using the -classpath option from the command line
when running the app outside of Eclipse...to no avail. It does not fix my
problem.

What is Eclipse doing that the export to the jar file doesn't? Will
someone please help? I have tried multiple things to fix this problem but
cannot get the application to run outside of Eclipse successfully.

My sincerest gratitude.
Re: exporting jar files [message #170951 is a reply to message #170924] Thu, 14 September 2006 08:33 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Patricia Loy wrote:

> Please forgive me if this is an extremely basic question that may have
> been answered previously. I have been trying to find the answer to my
> question for a couple of months now to no avail. I have searched the
> newsgroups and can't find the answer to my question.
>
> I have an application that I am working on that I inherited as part of
> my job.

If it is a normal Java application then the exporter does not include
the libraries that your code uses but simply packages the source code
which is in your project. This is correct because normally JARs do not
include other JARs. Hence when running outside Eclipse you have to setup
the classpath containing all the libraries that you use and the JAR that
you created.

Dani

> I am new to Eclipse and to Java. The application runs perfect in
> Eclipse. When I export to a jar file, it run fine until it tries to
> access a class that is contained within an external jar file. I have
> added this jar file in the Project Properties, I have included the
> path to the jar file in the classpath variable... In short, I have
> done everything I know to get this app to run without the error, which
> is the dreaded NoClassDefFoundError.
>
> I understand that this is probably a classpath error, but as I said
> previously, I've tried using the -classpath option from the command
> line when running the app outside of Eclipse...to no avail. It does
> not fix my problem.
>
> What is Eclipse doing that the export to the jar file doesn't? Will
> someone please help? I have tried multiple things to fix this problem
> but cannot get the application to run outside of Eclipse successfully.
>
> My sincerest gratitude.
>
Previous Topic:Global Actions on the RCP - writing my own implementations for COPY, PASTE, SELE
Next Topic:Multiple Editors - how do you switch?
Goto Forum:
  


Current Time: Fri Apr 26 23:21:44 GMT 2024

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

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

Back to the top