ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Ludwig <mil...@gmx.de>
Subject Re: Java in JDK but ANT can't find it!
Date Sat, 16 May 2009 18:30:45 GMT
David Nemer schrieb am 16.05.2009 um 18:52:34 (+0200):

> So here's what I did... I modified the source file JavaEnvUtils.java
> from ANT (ant.jar), I changed the line #47:
> 
> private static final String JAVA_HOME = System.getProperty("java.home");
> to: private static final String JAVA_HOME = System.getenv("JAVA_HOME");

I'd revert that change.

Maybe even do a clean install, in case anyone else migth have modified
the ant shell script.

> 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.
> It is currently set to "/opt/jdk1.6.0_06"

Try the equivalent of these on your system:

C:\dev\Java :: which java
C:/WINDOWS/java

C:\dev\Java :: java -jar \jlib\ant-1.7.1\lib\ant-launcher.jar -version
Unable to locate tools.jar. Expected to find it in
C:\Programme\Java\jre6\lib\tools.jar
Apache Ant version 1.7.1 compiled on June 27 2008

Because that's a JRE. But if I use the JDK, no warning.

C:\dev\Java :: C:\Programme\Java\jdk1.6.0_11\bin\java.exe -jar
\jlib\ant-1.7.1\lib\ant-launcher.jar -version
Apache Ant version 1.7.1 compiled on June 27 2008

Should work the same for you using explicit paths.

Michael Ludwig

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message