Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Application works inside Eclipse but NOT outside
Application works inside Eclipse but NOT outside [message #91893] Wed, 03 September 2003 15:13 Go to next message
Eclipse UserFriend
Originally posted by: nweber.sunwave.net

Hey,

I've got an Eclipse2 project that uses an external jar file. The app
works great from inside the Eclipse project but when I export the classes
and resources to a jar file, and run:

java -jar MyJar.jar

it seems that it can't find the classes in the referenced external jar file.

I'm running this on WinXP. I've set my classpath environment variable to
include the location of the external jar file as well as the current
location.

Any suggestions would be helpful...I've spent a whole day on this but no
luck.

Neil

--
Re: Application works inside Eclipse but NOT outside [message #92048 is a reply to message #91893] Thu, 04 September 2003 03:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: res0p2sx.verizon.net

"Neil Weber" <nweber@sunwave.net> wrote in message
news:bj5eig$8ci$1@eclipse.org...
> Hey,
>
> I've got an Eclipse2 project that uses an external jar file. The app
> works great from inside the Eclipse project but when I export the classes
> and resources to a jar file, and run:
>
> java -jar MyJar.jar
>
> it seems that it can't find the classes in the referenced external jar
file.
>
> I'm running this on WinXP. I've set my classpath environment variable to
> include the location of the external jar file as well as the current
> location.
>
> Any suggestions would be helpful...I've spent a whole day on this but no
> luck.
>
> Neil


What exactly is the classpath you're using? The classpath must have the full
path and name of the jar file I believe, not just the path of the jarfile.
Re: Application works inside Eclipse but NOT outside [message #92108 is a reply to message #91893] Thu, 04 September 2003 04:48 Go to previous message
Eclipse UserFriend
Originally posted by: hcs33.egon.gyaloglo.hu

Hi,

It is a java issue. If you want to run -jar file, the -classpath parameter
and CLASSPATH environment variable will be ignored. This is because you have
to specify all dependant libraries in the Manifest.mf file using the
'Class-Path:' entry.
So you can do:
a, use -jar and specify the libraries you use in the manifest file
b, use -classpath (including MyJar.jar) or CLASSPATH environment variable
and specify the main class to run (i.e. java -classpath MyJar.jar;...
my.jar.main.class.ClassFileName

HTH,
Regards,
Csaba

"Neil Weber" <nweber@sunwave.net> wrote in message
news:bj5eig$8ci$1@eclipse.org...
> Hey,
>
> I've got an Eclipse2 project that uses an external jar file. The app
> works great from inside the Eclipse project but when I export the classes
> and resources to a jar file, and run:
>
> java -jar MyJar.jar
>
> it seems that it can't find the classes in the referenced external jar
file.
>
> I'm running this on WinXP. I've set my classpath environment variable to
> include the location of the external jar file as well as the current
> location.
>
> Any suggestions would be helpful...I've spent a whole day on this but no
> luck.
>
> Neil
>
> --
>
>
>
Previous Topic:printed version of workbench/java users manuals for version 2.1
Next Topic:Can't convince Eclipse to build with non-default JRE
Goto Forum:
  


Current Time: Thu May 08 20:59:56 EDT 2025

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

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

Back to the top