Home » Language IDEs » Java Development Tools (JDT) » Problem exporting to JAR file & running on command line
Problem exporting to JAR file & running on command line [message #183252] |
Thu, 21 October 2004 17:15  |
Eclipse User |
|
|
|
Originally posted by: curt.schwaderer.mchsi.com
I've created a Java application using 3 projects within the Eclipse Java
perspective, for convenience, I'll call them project A, project B, &
project C. Project A also includes a JAR file (xmlrpc.jar in my
C:\Java\xmlrpc directory).
If I run this application within Eclipse, everything runs fine - all the
classes and JAR files are found and things run correctly.
Now, when I do "File->Export", select JAR file (we'll call it foo.jar),
make sure A, B, and C are all checked, and create the JAR file, things
seem fine. But when I go to the command prompt and attempt to run (java
-jar foo.jar), it complains that /org/apache/xmlrpc/WebServer.class (one
of the classes in xmlrpc.jar) isn't found.
The application runs correctly if I run it in the context of the Eclipse
debugger. So, why is the JAR creation utility leaving out xmlrpc.jar from
the foo.jar file even though it's part of project A?? Or is that correct
and I need to do something to reference it? I've set my CLASSPATH a bunch
of different ways with no correct result. Any help/advice MUCH appreciated!
Thanks,
Curt
|
|
|
Re: Problem exporting to JAR file & running on command line [message #184413 is a reply to message #183252] |
Fri, 05 November 2004 08:58   |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
Curt wrote:
>I've created a Java application using 3 projects within the Eclipse Java
>perspective, for convenience, I'll call them project A, project B, &
>project C. Project A also includes a JAR file (xmlrpc.jar in my
>C:\Java\xmlrpc directory).
>
>If I run this application within Eclipse, everything runs fine - all the
>classes and JAR files are found and things run correctly.
>
>Now, when I do "File->Export", select JAR file (we'll call it foo.jar),
>make sure A, B, and C are all checked, and create the JAR file, things
>seem fine. But when I go to the command prompt and attempt to run (java
>-jar foo.jar), it complains that /org/apache/xmlrpc/WebServer.class (one
>of the classes in xmlrpc.jar) isn't found.
>
>The application runs correctly if I run it in the context of the Eclipse
>debugger. So, why is the JAR creation utility leaving out xmlrpc.jar from
>the foo.jar file even though it's part of project A?? Or is that correct
>and I need to do something to reference it?
>
JARs in JAR is not supported by Java.
Dani
> I've set my CLASSPATH a bunch
>of different ways with no correct result. Any help/advice MUCH appreciated!
>
>Thanks,
>Curt
>
>
>
>
|
|
|
Re: Problem exporting to JAR file & running on command line [message #184434 is a reply to message #183252] |
Fri, 05 November 2004 09:04  |
Eclipse User |
|
|
|
Originally posted by: hcs33.egon.gyaloglo.hu
Hi,
Take a look at the Fat Jar plugin (http://fjep.sourceforge.net/). It should
do exactly what you want (creates one jar file which includes all classes
from projects and referenced jars).
HTH,
Regards,
Csaba
"Curt" <curt.schwaderer@mchsi.com> wrote in message
news:cl98u7$kj6$1@eclipse.org...
> I've created a Java application using 3 projects within the Eclipse Java
> perspective, for convenience, I'll call them project A, project B, &
> project C. Project A also includes a JAR file (xmlrpc.jar in my
> C:\Java\xmlrpc directory).
>
> If I run this application within Eclipse, everything runs fine - all the
> classes and JAR files are found and things run correctly.
>
> Now, when I do "File->Export", select JAR file (we'll call it foo.jar),
> make sure A, B, and C are all checked, and create the JAR file, things
> seem fine. But when I go to the command prompt and attempt to run (java
> -jar foo.jar), it complains that /org/apache/xmlrpc/WebServer.class (one
> of the classes in xmlrpc.jar) isn't found.
>
> The application runs correctly if I run it in the context of the Eclipse
> debugger. So, why is the JAR creation utility leaving out xmlrpc.jar from
> the foo.jar file even though it's part of project A?? Or is that correct
> and I need to do something to reference it? I've set my CLASSPATH a bunch
> of different ways with no correct result. Any help/advice MUCH
appreciated!
>
> Thanks,
> Curt
>
>
|
|
|
Goto Forum:
Current Time: Thu May 08 14:07:46 EDT 2025
Powered by FUDForum. Page generated in 0.07500 seconds
|