Ant cannot find Javac. No matter what I do, he always claims that JAVA_HOME is "C: \ Program Files \ Java \ jre6"

... and this is wrong.

Here is the error I get:

STRICTLY MALFUNCTIONAL 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 javac compiler; com.sun.tools.javac.Main is not in the classpath. Maybe JAVA_HOME is not pointing to the JDK. Currently set to "C: \ Program Files \ Java \ jre6"

I set the JAVA_Home environment variable to point to: "C: \ Program Files \ Java \ jdk1.6.0_12"

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

I have% JAVA_HOME% \ Bin in the PATH variable.

I hit the various "JavaHome" settings under HKLM \ SOFTWARE \ JavaSoft, and now I'm completely stuck.

All I wanted to do was build the Java applet from the command line using build.xml, which netbeans had done for the project.

Any ideas anybody?

+7
java ant java-home
source share
6 answers

Good ANT now works.

What I've done?

I deleted it from c: \ program files and "reinstalled" it in "c: \ ant"

It seems that he does not like file names or directories other than 8.3.

Oddly enough, I did this only because I misunderstood the part of the manual in which the proposed ANT should not be in places with a non-standard arrangement in the 8.3 format on 95/98 / ME. I did not notice the links to the OS and made it clear to her. I am running Vista.

Oh good...

Thanks for helping the guys.

+7
source share

In eclipse, set the installed JRE parameter in the JDK - in the project (project properties → Java Build Path-> Libraries) or the global default settings (Java-> Installed JREs). Configuring eclispe is stronger than the system one.

+5
source share

Just include tools.jar in the ant class path, wherever it is installed.

+2
source share

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

0
source share

What build process do you use? Is one of the JAVA_HOME build scripts?

0
source share

Ok guys, for Windows 7 it needs JAVA_HOME as a Windows environment variable, I also added C: \ Program Files \ Java \ jdk1.7.0_03 \ and C: \ Program Files \ Java \ jdk1.7.0 _03 \ bin in PATH, restarted Eclipse, now it works ... Well, I have other problems: D

-one
source share

All Articles