1
votes

I had java jdk 1.6 installed, and today installed jdk 1.7 becaused needed to compile new project. So changed JAVA_HOME from 1.6 path to 1.7 path and created project using jdk 1.7 when i tried to compile using ANT (build.xml) i got this error that cannot find javac1.7 class... cheked compiler (preferences-java-compiler) and it is 1.6(also there is 1.5 .1.4) but no 1.7 which I need. So, maybe someone knows solution for this problem? Thank You. sorr for bad english.

1
The use of the JAVA_HOME variable is deprecated; these days the java installation updates your registry. Either way, you need ot make sure the 1.7 JDK is on your PATH. Does the javac command work from the command line? And does javac -version return the expected Java 1.7 path? - Roddy of the Frozen Peas
You have to change the used JRE in preferences/java/installedJRes too. - Denys Séguret
Yep, java version returns java 1.7 and javac also works - Palaima
dystroy - i chaged that, forgot to mention :[ - Palaima
It must be your version of Eclipse, so (see answer). - Denys Séguret

1 Answers

2
votes

Be careful that :

Eclipse uses a specific compiler. They mention here what functions they added in Eclipse for the JDK1.7.