JFreeChart in DOS console

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
raulosan
Posts: 5
Joined: Mon Jan 18, 2010 5:02 pm
antibot: No, of course not.

JFreeChart in DOS console

Post by raulosan » Thu Jan 21, 2010 11:54 am

Hello,

I need to execute an application that uses JFreeChart outside the IDE (Eclipse) in DOS command line.

This is the procedure I follow:

1- Export the project outside Eclipse with a .jar compression (OutsideExported.jar) to the destination folder (D:/temp/java).

2- Execute the single class of the project that contains the main method (OutsideClass.class) and is included in a package (outsidePackage):
D:/temp/java/java -classpath OutsideExported.jar outsidePackage.OutsideClass

It works in Eclipse but in command line I become this failure:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jfree/data/general/PieDataSet

The application is a very simple example that i took from a tutorial:
http://www.screaming-penguin.com/node/4005

In case that this exporting weren´t possible, is it possible to compile java with JFreeChart in the DOS console?

Regards,

Raúl

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Re: JFreeChart in DOS console

Post by skunk » Thu Jan 21, 2010 2:29 pm

Just include the two jar files in your classpath

raulosan
Posts: 5
Joined: Mon Jan 18, 2010 5:02 pm
antibot: No, of course not.

Re: JFreeChart in DOS console

Post by raulosan » Thu Jan 21, 2010 3:03 pm

It works!
Thankyou very much.

D:/temp/java/java -classpath OutsideExported.jar;jcommon-1.0.16.jar;jfreechart-1.0.13.jar outsidePackage.OutsideClass

Locked