Where to get tools.jar for Java 8 JDK early release? Without it, my Java 1.8 Maven pom based projects in Netbeans will not compile.
The Java 8 early release is set in
Answer on the behalf of OP:
This version is missing tools.jar
: jdk-8-ea-bin-b106-windows-i586-05_sep_2013.exe
It is now in the most recent release.
I was using Hadoop-Common-2.7.2 as a dependency, When I add exclusions in my POM.xml, my issue got resolved.
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.7.2</version>
<exclusions>
<exclusion>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
</exclusion>
</exclusions>
</dependency>
When I looked at Eclipse > Window > preference > Java > Installed JRE >
it was pointing to JRE
, which seems obvious, but when I changed the pointing to JDK
the compile error was resolved since there was tools.jar
now in JDK
.
Before this I had tried copying tools.jar
from jdk/lib
to jre/lib
, but that did not solve the issue.
The error only appears when I hadn't installed the JDK in its default directory.
Install it on the default directory to resolve the problem.
Source.
tools.jar was removed in Java 9. https://docs.oracle.com/javase/9/migrate/toc.htm#GUID-12237744-E23B-42F8-8892-26BA1BDD63F2
The solution is to update the eclpise.ini, If no JDK is used for Eclipse, change it:
-vmargs
-vmargs
, add two lines:-vm
C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe
on Windows)*Solution also documented here