views:

3098

answers:

4

...and that's wrong.

Here's the error I get:

BUILD FAILED C:_TraderPlatform\Clients\Open\Open\Java\Applets\PPDataTransporter\nbproject\build-impl.xml:338: The following error occurred while executing this line: C:_TraderPlatform\Clients\Open\Open\Java\Applets\PPDataTransporter\nbproject\build-impl.xml:158: 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 "C:\Program Files\Java\jre6"

I've set an environment variable called JAVA_Home to point to: "C:\Program Files\Java\jdk1.6.0_12"

Javac.exe is definitely in C:\Program Files\Java\jdk1.6.0_12\bin

I've got %JAVA_HOME%\Bin in my PATH variable.

I've mucked around with the various 'JavaHome' settings under HKLM\SOFTWARE\JavaSoft and I'm now utterly stuck.

All I wanted to do was build a Java applet from the command line using the build.xml that netbeans had knocked up for the project.

Any ideas anybody?

A: 

You need to check that the variable name is JAVA_HOME all uppercase. Also, run path from the command line and ensure that the path statement has the correct value for JAVA_HOME.

Vincent Ramdhanie
it's there all in upper case and PATH returns the right values
On Windows, Environment variables are case-insensitive.
Dave Webb
A: 

What build process are you running? Is one of the build scripts setting JAVA_HOME?

Dave Webb
+2  A: 

Well ANT now works.

What did I do?

I removed it from c:\program files and 'reinstalled' it into "c:\ant"

Seems like it doesn't like non 8.3 filenames or directories.

Funnily enough I did this only because I misread the part of the manual that suggested ANT shouldn't be in non 8.3 style locations on 95/98/ME. I didn't spot the OS reference and gave it a go. I'm running Vista.

Oh well...

Thanks for your help guys.

I think this can work if you use a 8.3 file name for ANT_HOME e.g. `C:\Progra~1`. *Installing Ant in a **short**, 8.3 path such as C:\Ant* is a good practice though as stated in the documentation.
Pascal Thivent
A: 

Just include tools.jar on the ant classpath, wherever it is installed.

TheCoolestSid
I was getting the same problem in eclipse, where i was using an ant plugin. I could not find any mistakes in the JAVA_HOME. I was looking at the property page for ant where it saud that tools.jar is required on the classpath for ant. I did that and the problem vanished.
TheCoolestSid