ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject ant can't find javac compiler
Date Thu, 22 Sep 2005 09:13:28 GMT

I am using ant to compile my struts webapp. I am using Linux 2.4.27 and 
running ant (1.5.2-26) from my shell which is bash. My environment variables 
which I set in my .bash_profile are:

Here is my problem. When I compile my classes using the default compiler for 
my system (kjc) I get this error: 

error: Can't find default package `java.lang'. Check the CLASSPATH 
environment variable and the access to the archives 

Which I can live with (even though my CLASSPATH variable is probably 
correct) since I really ought to be using the jdk1.5.0_02 compiler. If I set 
the compiler attribute of <javac> task in my build.xml to modern, it should 
use the javac compiler that comes with my JDK. When I do I get this error: 

Unable to find a javac compiler; is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK 

If I run the javac command manually from the command prompt, something like 
javac -cp MY/VERY/LONG/CLASSPATH/ src/uk/co/webotech/myproject/ 

It compiles fine... By the way, typing "which javac" in my shell returns 
/usr/java/jdk1.5.0_02/bin/javac. How can I get ant to find javac? 

Any help with this would be greatly appreciated! 


Paul Mackinlay (PhD, MEng)
Tel: +44(0)7050 699971
Fax: +44(0)7050 699972

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message