A
asd
Hi all,
My application is something like this:
I have two files:
c:\test\a\b\JarTest.class
c:\test\c\d\JarMan.class
The java code is as follows:
JarTest.java
------------
package a.b;
import c.d.JarMan;
public class JarTest{
public static void main(String asd[]){
JarMan jm = new JarMan();
jm.testFunc();
}
}
JarMan.java
------------
package c.d;
public class JarMan{
private int a;
public void testFunc(){
System.out.println("print:: "+this.a);
}
}
Now I created a jar file out of c/d/JarMan.class with the correct
directory structure called jarman.jar.
And created an exceutable jar file out of a/b/JarTest.class called
jartest.jar.
The manifest file in jartest.jar looks like this:
Manifest-Version: 1.0
Created-By: 1.4.2_04 (Sun Microsystems Inc.)
Main-Class: a.b.JarTest
Now from within the c:\test folder I try to execute jartest.jar and
this is what happens:
C:\test>java -classpath c:\test\jarman.jar; -jar jartest.jar
Exception in thread "main" java.lang.NoClassDefFoundError: c/d/JarMan
at a.b.JarTest.main(JarTest.java:7)
Strange isnt it?
Now when I extract the contents of jartest.jar and try it works:
C:\test>java -classpath c:\test\jarman.jar; a/b/JarTest
print:: 0
My head is spinning with this problem :-(
Help me out!!!
Thanks in advance.
regards,
ASD
My application is something like this:
I have two files:
c:\test\a\b\JarTest.class
c:\test\c\d\JarMan.class
The java code is as follows:
JarTest.java
------------
package a.b;
import c.d.JarMan;
public class JarTest{
public static void main(String asd[]){
JarMan jm = new JarMan();
jm.testFunc();
}
}
JarMan.java
------------
package c.d;
public class JarMan{
private int a;
public void testFunc(){
System.out.println("print:: "+this.a);
}
}
Now I created a jar file out of c/d/JarMan.class with the correct
directory structure called jarman.jar.
And created an exceutable jar file out of a/b/JarTest.class called
jartest.jar.
The manifest file in jartest.jar looks like this:
Manifest-Version: 1.0
Created-By: 1.4.2_04 (Sun Microsystems Inc.)
Main-Class: a.b.JarTest
Now from within the c:\test folder I try to execute jartest.jar and
this is what happens:
C:\test>java -classpath c:\test\jarman.jar; -jar jartest.jar
Exception in thread "main" java.lang.NoClassDefFoundError: c/d/JarMan
at a.b.JarTest.main(JarTest.java:7)
Strange isnt it?
Now when I extract the contents of jartest.jar and try it works:
C:\test>java -classpath c:\test\jarman.jar; a/b/JarTest
print:: 0
My head is spinning with this problem :-(
Help me out!!!
Thanks in advance.
regards,
ASD