ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Chamberlain" <>
Subject RE: Problem with setting JAVA_HOME for Ant
Date Tue, 08 Apr 2008 22:49:38 GMT
Never mind.  I figured it out.   I need JAVA_HOME to point to the jdk
directory, not to the bin directory beneath it.  When I do that, everything

Sorry for the bother.

 == Eric ==

-----Original Message-----
From: Eric Chamberlain [] 
Sent: Tuesday, April 08, 2008 3:42 PM
To: 'Ant Users List'
Subject: RE: Problem with setting JAVA_HOME for Ant

I had already done that.   I have JAVA_HOME defined correctly defined as a
user-level.   I can see that JAVA_HOME is defined and defined correctly in
the command prompt window in which I run ant.    I just cannot get Ant to
use it.  Arrgh!

If it helps, this is what Ant says:

c:\....\nbproject\build-impl.xml:337: The following error occurred while
executing this
c:\....\nbproject\build-impl.xml:168: Unable to find a javac compiler; is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre1.5.0_06"

This is not the correct location.  

The correct location is c:\VPTrunk\src\ext\jdk\bin which is the value of
JAVA_HOME at the point I invoke ant.

 == Eric ==

-----Original Message-----
From: David Brown [] 
Sent: Tuesday, April 08, 2008 3:32 PM
To: Ant Users List
Subject: Re: Problem with setting JAVA_HOME for Ant

Hello, I have found the best thing to do with Windows is define JAVA_HOME
in: My Computer/System Properties dialog. Click the Advance Tab Pane and
click the button: Environment Variables. Don't do this as Administrator but
just as the user you are when you are running Ant at the command-line. HTH

Eric Chamberlain wrote ..
> I have a real mystery and cannot find the solution anywhere I have looked
> (including the Ant FAQ).
> Summary:   When I run Ant, it looks somewhere other than JAVA_HOME for the
> java directory.
> I am running Ant on Windows XP to execute a NetBeans-generated build.xml.
> One step I have tried has been to run 
>    ant -diagnostics
> Which confirms that java.home is located somewhere other than JAVA_HOME
> even in the same directory tree).
> Here is my question:   How can I change the value of java.home for ant?
> What .properties file do I have create?   Why does ant ignore it if I type
>    ant -Djava.home=%JAVA_HOME% -f mybuildfile.xml
> I was expecting to override the java.home there but it didn't happen.
> I am left rather puzzled.
> Eric Chamberlain
> Software Engineer

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

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

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

View raw message