Application works inside Eclipse but NOT outside [message #91893] |
Wed, 03 September 2003 15:13  |
Eclipse User |
|
|
|
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 #92108 is a reply to message #91893] |
Thu, 04 September 2003 04:48  |
Eclipse User |
|
|
|
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
>
> --
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03201 seconds