Quantcast

Unable to locate the Javac Compiler Problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unable to locate the Javac Compiler Problem

qrtt1
Dear all, I found a strange problem about the "Unable to locate the Javac Compiler"
Unable to locate the Javac Compiler in:
  C:\Program Files\Java\jre6\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
Both JAVA_HOME and eclipse -vm option are set, it occurred after the m2eclipse installed long time ago. Today it raised suddenly. However the error message may be confused. The tools.jar doesn't locate in C:\Program Files\Java\jre6\..\lib\tools.jar. my JDK directory is liked this:
├─jdk1.6.0_17
│  ├─bin
│  ├─demo
........................................
│  ├─jre
│  │  ├─bin
│  │  │  ├─client
│  │  │  ├─new_plugin
│  │  │  └─server
│  │  └─lib
.........................................
│  ├─lib
.........................................
├─jre6
│  ├─bin
│  │  ├─client
│  │  └─new_plugin
│  └─lib
.........................................
└─lib (doesn't exist)
I create the lib and put tools.jar in that jre6/../lib, it works.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to locate the Javac Compiler Problem

Andreas M
qrtt1 wrote
Dear all,

I found a strange problem about the "Unable to locate the Javac Compiler"

<pre>
Unable to locate the Javac Compiler in:
  C:\Program Files\Java\jre6\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
</pre>

Both JAVA_HOME and eclipse -vm option are set, it occurred after the m2eclipse installed long time ago.
Today it raised suddenly. However the error message may be confused. The tools.jar doesn't locate in C:\Program Files\Java\jre6\..\lib\tools.jar.

my JDK directory is liked this:
<pre>
├─jdk1.6.0_17
│  ├─bin
│  ├─demo
........................................
│  ├─jre
│  │  ├─bin
│  │  │  ├─client
│  │  │  ├─new_plugin
│  │  │  └─server
│  │  └─lib
.........................................
│  ├─lib
.........................................
├─jre6
│  ├─bin
│  │  ├─client
│  │  └─new_plugin
│  └─lib
.........................................
└─lib (doesn't exist)
</pre>

I create the lib and put tools.jar in that jre6/../lib, it works.
A co-worker of mine had the same problem a couple of days ago. That was on a newly installed machine, and he was the only one in a group of ten who managed to do something so that it didn't work.

We still don't know why, but he solved it by adding these two line to his eclipse.ini:
-vmargs
-Djava.home=c:\Program Files\Java\jdk1.6.0_20\jre

And yes, we already had tried with -vm, JAVA_HOME etc. None of those took.

/Andreas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to locate the Javac Compiler Problem

Tzarr
This post has NOT been accepted by the mailing list yet.
I fixed the problem by changing the used JRE to the one inside the JDK.

Go to Preferences/Java/Installed JREs and add one for the location "C:\Program Files\Java\jdk1.6.0_27\jre" or something like that.
Remove the one for "C:\Program Files\Java\jre6".

As you can see, the path "C:\Program Files\Java\jre6\..\lib\tools.jar" only makes sense if the first part (til the /..) is replaced by "C:\Program Files\Java\jdk1.6.0_27\jre".

Regards...
Loading...