| Author |
Cannot Find javac
|
Natalie Kopple
Ranch Hand
Joined: May 06, 2003
Posts: 320
|
|
I have jdk1.6.0_23 installed in C:\Program Files\java\
and I have JAVA_HOME pointing to my jdk1.6.0_23.
%JAVA_HOME%\bin\ is in my path.
however, I got
Unable to locate the Javac Compiler in: C:\Program Files\Java\jre6\..\lib\tools.jar
Please advise what I should do. Thank you.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12907
|
|
For some reason your Java installation is looking in the wrong place for the Java compiler (you see it has "jre6" in the path, instead of the directory where you have the JDK installed).
What exactly does your PATH look like; what do you get as the answer from the following command: echo %PATH%
Did you also set a CLASSPATH? If yes, then unset it (delete the environment variable).
Where do you get this "Unable to locate the Javac Compiler" error message? On the command prompt, when you try to compile a class? Or in an IDE? If it is in an IDE, then point the IDE to your JDK directory, not the JRE directory.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Natalie Kopple
Ranch Hand
Joined: May 06, 2003
Posts: 320
|
|
Thanks very much for your reply.
I am using the Eclipse. How do I point Eclipse to JDK instead of JRE? Thanks.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12907
|
|
Eclipse doesn't need a JDK, because it has its own built-in compiler. It should work with just a JRE. Maybe you're using some plug-in that needs a Java compiler inside Eclipse.
But... You can go to Window / Preferences / Java / Installed JREs and add your JDK there.
|
 |
Natalie Kopple
Ranch Hand
Joined: May 06, 2003
Posts: 320
|
|
Thanks for your prompt reply. I have successfully get rid of the problem.
|
 |
 |
|
|
subject: Cannot Find javac
|
|
|