A
andrew123
Hi,
I am really suffering with trying to execute a class from within a jar
file.
What I've done:-
I have created a jar called tester.jar, within this jar I have a
directory structure of
com.amm.mar.bo.gh at the bo level I have my main class that supposed to
run called tester.class
I have other class files that are referenced at the gh level.I also
reference the external packages of log4j and jdom(seperate jars in same
dir)
When I try to run this jar I get a
Exception in thread "main" java.lang.NoClassDefFoundError: tester/java
I run it by doing the following commands:-
java -cp ./:tester.jar:./log4j.jar:/jdom.jar -jar tester.jar
com.amm.mar.bo.tester
I've also tried variants of this by having differnt classpaths, but to
no avail. I created a manifest file as well
which reads as:-
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: 1.4.2_03-b02 (Sun Microsystems Inc.)
Version: 1.0
Main-Class: com.amm.mar.bo.tester
Class-Path: jdom.jar:log4j-1.2.9.jar:jconn3.jar:tester.jar
The strange thing is it all works in eclipse and was built using
ant....
I've tried bith winxp and solaris...
Any ideas what I'm doign wrong ?
I am really suffering with trying to execute a class from within a jar
file.
What I've done:-
I have created a jar called tester.jar, within this jar I have a
directory structure of
com.amm.mar.bo.gh at the bo level I have my main class that supposed to
run called tester.class
I have other class files that are referenced at the gh level.I also
reference the external packages of log4j and jdom(seperate jars in same
dir)
When I try to run this jar I get a
Exception in thread "main" java.lang.NoClassDefFoundError: tester/java
I run it by doing the following commands:-
java -cp ./:tester.jar:./log4j.jar:/jdom.jar -jar tester.jar
com.amm.mar.bo.tester
I've also tried variants of this by having differnt classpaths, but to
no avail. I created a manifest file as well
which reads as:-
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: 1.4.2_03-b02 (Sun Microsystems Inc.)
Version: 1.0
Main-Class: com.amm.mar.bo.tester
Class-Path: jdom.jar:log4j-1.2.9.jar:jconn3.jar:tester.jar
The strange thing is it all works in eclipse and was built using
ant....
I've tried bith winxp and solaris...
Any ideas what I'm doign wrong ?