• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot Find javac

 
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your prompt reply. I have successfully get rid of the problem.

 
I think I'll just lie down here for a second. And ponder this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic