ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Nemer <davidne...@gmail.com>
Subject Re: Java in JDK but ANT can't find it!
Date Sat, 16 May 2009 18:51:31 GMT
Hello Michael,

I undid that change into JavaEnvUtils.java.

I executed the commands you said, and here is the outcome:

nemer@kubrick:~$ java -jar /home/nemer/apache-ant-1.7.1/lib/ant-launcher.jar
-version
Apache Ant version 1.7.1 compiled on June 27 2008

nemer@kubrick:~$ /opt/jdk1.6.0_06/bin/java -jar
/home/nemer/apache-ant-1.7.1/lib/ant-launcher.jar -version
Apache Ant version 1.7.1 compiled on June 27 2008

so just running JAVA worked as well as running /opt/jdk1.6.0_06/bin/java

--
David Nemer
Sent from Kaiserslautern, RP, Germany

On Sat, May 16, 2009 at 8:30 PM, Michael Ludwig <milu71@gmx.de> wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message