There's reason to t hink that this is actually a Java problem, not specific to jFreeCHart, but I'm hoping that someone else has found a reasonable workaround.
I have a jFreeChart application running well on my desktop, and the time has come to see if anyone else can run it too. After bundling all of my class-files into a single jar, and setting a CLASSPATH on a target system to pick up jfreechart and jcommon, this doesn't seem to work:
java -jar MyJFreeApp.jar
It throws java.lang.NoClassDefFoundError:org/jfree/data/time/RegularTimeException
Back-checking, it turns out that the "java -jar" command doesn't even work on the workstation where the jar-file was built!
Searching through Sun's Java site, I find numerous threads with similar complaints. ('Similar' in the sense that classes contained in 3rd-party jar-files aren't found.) Most of them peter out, however, before a satisfactory solution has been described.
Has anyone reading this found a reasonably clean workaround?
Thanks,
Irv Thomae
ISTS/Dartmouth College
Hanover, NH (USA)
Deploy jFreeChart app in jar form ->NoClassDefFoundError
Re: Deploy jFreeChart app in jar form ->NoClassDefFoundError
I am having the same issue. Not sure if adding activity to these threads increases the likelyhood of a useful response or not but I thought it was worth a shot. (Like pushing the elevtator but lots of times)
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: Deploy jFreeChart app in jar form ->NoClassDefFoundError
You have to add the required names to the Class-Path attribute of your JAR's manifest.
Re: Deploy jFreeChart app in jar form ->NoClassDefFoundError
Thought I'd add my experience with this problem. I got the the error trying to run an eclipse jar file at cmd. The problem is that you can't run the jfreechart and jcommon jar files from within the app jar file (see note in the Java Tutorial refered to by John in previous post). I had to extract the files into the directory where my app jar is located. Using Launch4J worked better because I could include reference to the jfreechart and jcommon jar files in the Classpath tab. PS Love jfreechart! Well done to all contributors.