java - setting JAVA_HOME in windows 7 -


i getting following error when try run ant buildfile in eclipse:

build failed c:\mypath\myapp\buildwar.xml:16: unable find javac compiler; com.sun.tools.javac.main not on classpath. perhaps java_home not point jdk. set "c:\program files\java\jre7"   

i located jdk @ c:\mypath\java\jdk1.7.0_17\bin\javac.exe

i used methods in blog entry create system environmental variable in windows 7 called java_home , mapped c:\mypath\java\jdk1.7.0_17\bin\javac.exe . when error persisted, restarted computer, tried again, , got same error. changed mapping of java_home c:\mypath\java\jdk1.7.0_17\bin\ , still got same error.

can show me how past error, can run ant build file in eclipse?


edit:

i getting same exact error message again today when try run ant buildfile, though java_home set per answers below, , though path variable includes %java_home%\bin . have checked values of these environmental variables in windows control panel section setting environmental variables, though eclipse console gives above error message saying java_home set jre. have suggestions how fix recurring problem?


second edit:

changing java home in eclipse fixed problem. eclipse java home separate windows java home.

set java_home c:\mypath\java\jdk1.7.0_17\

then in path variable add %java_home%\bin


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -