ant build error with SUSE Linux 10.1

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
tbrauer01
Posts: 3
Joined: Wed Jun 14, 2006 7:32 pm

ant build error with SUSE Linux 10.1

Post by tbrauer01 » Wed Jun 14, 2006 7:40 pm

Hello,

I am attempting to build the JFreeChart libraries as according to the install instructions on a SUSE Linux 10.1 system. After execution of "ant compile" received the following error:

Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/lib/tools.jar
Buildfile: build.xml

initialise:

compile:
[javac] Compiling 464 source files to /data/jFreeChart/jfreechart-1.0.1/build

BUILD FAILED
/data/jFreeChart/jfreechart-1.0.1/ant/build.xml:53: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

note: I can compile / run other java programs directly from the command line so believe the JAVA_HOME is set correctly.

I appreciate any help with this issue and can provide more details if needed (e.g. ant debug output).

thank you.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Jun 15, 2006 10:45 am

I've seen this on my system (Ubuntu Linux) also. I fixed it with:

Code: Select all

export JAVA_HOME=/home/dgilbert/jdk1.5.0_07/
Because I test with a few different JDKs, I tend to have them just dumped in my home directory rather than installed "properly"...that's lazy and messy, but it works for me.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Post by Taqua » Thu Jun 15, 2006 11:54 am

Hi,
/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/lib/tools.jar
It seems you're using the gnu-compiler. That one is not fully compatible to the real JDK, so you need a standard-compliant JDK instead. Grab one from Sun, IBM or any other JDK-Vendor and Ant will work much better.


(You won't have much fun with the Gnu-Compiler anyway, as the out-of-the-box Classpath project versions are not able to run JFreeChart properly.)

Regards,
Thomas

tbrauer01
Posts: 3
Joined: Wed Jun 14, 2006 7:32 pm

Post by tbrauer01 » Thu Jun 15, 2006 12:52 pm

Gentleman,

thank you very much for the responses / suggestions. I downloaded and installed current version of JDK from Sun (1.5) and so now the JFreeChart files compiled just fine.

thank you.

elpeicher2
Posts: 1
Joined: Thu Jun 15, 2006 2:00 pm
Location: Sri lanka
Contact:

Post by elpeicher2 » Thu Jun 15, 2006 2:02 pm

hi, i had the same problem, installed the 1.5 and it works now :)

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Jun 15, 2006 2:31 pm

Taqua wrote:(You won't have much fun with the Gnu-Compiler anyway, as the out-of-the-box Classpath project versions are not able to run JFreeChart properly.)
This is changing rapidly, though. With the latest GNU Classpath from CVS, JFreeChart is running really well. See the following screenshots:

http://www.jfree.org/jfreechart/samples-gnu.html

The next developer snapshot (0.92) is due in July.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked