Page 1 of 1


Posted: Tue Mar 01, 2005 3:05 pm
by RoyT
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;

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...

Posted: Mon Mar 21, 2005 6:45 am
by djr10007a
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!

Posted: Mon Mar 21, 2005 10:56 am
by RoyT

My problem was caused by Apache Tomcat not using the classpath. When I put the jar file into the lib directory then it all worked.

Best of luck with your problem.


Posted: Mon Jun 27, 2005 2:43 pm
by cassidyh
I am having the same problem with running my app from Eclipse is fine, but when I create a jar, nothing happens. SOmebody please help

Posted: Mon Jun 27, 2005 3:06 pm
by RoyT
Hi cassidyh.

I am sorry but I do not know anything about Eclipse or how it sets its classpath or where appropriate files should be stored.


Posted: Tue Jun 28, 2005 3:35 pm
by Mimil

Tell us a bite more about how you are doing perhaps it will be easier.
But jars need classes to be also in the path, so did you do this properly?

eclipse problems

Posted: Tue Jun 28, 2005 3:44 pm
by cassidyh
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

Posted: Tue Jun 28, 2005 3:51 pm
by Mimil

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).

Posted: Tue Jun 28, 2005 3:59 pm
by cassidyh
HOw do write that into the manifest file? I am not so sure about how to do it, but that would be great. I appreciate any help, because my way works, but it is by far not very effective at all.

Posted: Tue Jun 28, 2005 4:04 pm
by Mimil

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
Here is the reference doc :

Posted: Thu Sep 15, 2005 12:53 pm
by Vincent643
You can't include jars in an other jar.
Thank you Mimil for this! Thanks a lot, that is exaclty what I was looking for.


Posted: Thu Sep 15, 2005 3:19 pm
by Taqua

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.