NoClassDefFoundError
NoClassDefFoundError
Hi, I cannot understand why I get the above error when running my java app under Apache Tomcat, when the compile picks up the class ok. The class in question is FloatDimension.
I have set up my classpath to include jcommon-0.9.7.jar, and I have code containing
import org.jfree.ui.FloatDimension;
and
factory.setMinimumSize(new FloatDimension(150, 20));
The class is obviously picked up at compile, but then falls over when initialising the class containing the above code.
Any ideas please?
I have set up my classpath to include jcommon-0.9.7.jar, and I have code containing
import org.jfree.ui.FloatDimension;
and
factory.setMinimumSize(new FloatDimension(150, 20));
The class is obviously picked up at compile, but then falls over when initialising the class containing the above code.
Any ideas please?
same for me...
Just curious, did you solve this yet?
I am having a similar problem using Eclipse. Under the IDE, my application runs fine, but when I export it to an executable JAR, I get the NoClassDefFound error like you.
I wish to generate a single executable jar containing the jfreechart classes, but can't seem to get it to happen!
I am having a similar problem using Eclipse. Under the IDE, my application runs fine, but when I export it to an executable JAR, I get the NoClassDefFound error like you.
I wish to generate a single executable jar containing the jfreechart classes, but can't seem to get it to happen!
eclipse problems
I actually had to extract all source files from Jcommon.jar as well as from jfreechart.jar and add it to my project before I packed it into a self-executable jar file. That is the only way to make the code portable. It is also ridiculous...I mean, what's the point of using a jar file for classes, if the jar utility won't pack the jar files with it. And yes, I did have all necessary jar files on my build path. Now, I can transport my code into a self-executable, but I am not very happy about having to add all the source and class files to my jar instead of just the jar files. Maybe this is an Eclipse bug.....don't know
cass
cass
Hi,
As for me, and my understanding of java, you will have to carry all the jars. You can't include jars in an other jar. But you can set a classpath attribut in your manifest to tell where are located the other jars (and it can be relative).
As for me, and my understanding of java, you will have to carry all the jars. You can't include jars in an other jar. But you can set a classpath attribut in your manifest to tell where are located the other jars (and it can be relative).
A student of JFree & Pentaho Academies
Bye,
Cedric Pronzato
Bye,
Cedric Pronzato
Hi,
here is an exemple of one auto generated by ant:
Here is the reference doc : http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html
here is an exemple of one auto generated by ant:
Code: Select all
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: 1.2.2 (Sun Microsystems Inc.)
Class-Path: lib/jcommon-1.0.0-rc1.jar lib/pixie-0.8.4.jar
A student of JFree & Pentaho Academies
Bye,
Cedric Pronzato
Bye,
Cedric Pronzato
Well,
actually, there is a way to create such jars. It involves writing an own Classloader that accesses the jars stored inside. That's the deepest black magic possibly imaginable. But as usual: Someone already did it.
http://classworlds.codehaus.org/uberjar.html
Regards,
Thomas
actually, there is a way to create such jars. It involves writing an own Classloader that accesses the jars stored inside. That's the deepest black magic possibly imaginable. But as usual: Someone already did it.
http://classworlds.codehaus.org/uberjar.html
Regards,
Thomas