'tools.jar' seems to be not in IDEA classpath. Please ensure JAVA_HOME points to JDK rather than JRE.

Answered

I am windows users having trouble launching intelij IDE 64 version, with the following error.
 
'tools.jar' seems to be not in IDEA classpath.
Please ensure JAVA_HOME points to JDK rather than JRE.

I have installed JDK 1.8
java -version gives the following information

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)

I have installed JDK at D:\Program Files\Java\jdk1.8.0_66 in my machine
And have set JAVA_HOME environment variable both at user level and system level to D:\Program Files\Java\jdk1.8.0_66\
I have also set IDEA_JDK_64 environment variable both at user level and system level to D:\Program Files\Java\jdk1.8.0_66\

Nothing seems to be helping..

Can some body help me with this..

I have spends several hours today..
 

17 comments

Do you have D:\Program Files\Java\jdk1.8.0_66\lib\tools.jar file?

Do you start IDEA with idea64.exe file? Otherwise IDEA_JDK_64 has no effect. See also https://intellij-support.jetbrains.com/entries/23455956 .

0

There is not tools.jar in D:\Program Files\Java\jdk1.8.0_66\lib\ directory.
I did run idea64.exe got the same error,
How can I get tools.jar?
I installed JDK from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html  downloading jdk-8u66-windows-x64.exe which is 186.65 MB, So I am sure I have downloaded JDK installer and installed it not JRE.


Searching in google  I came across a post http://stackoverflow.com/questions/19722058/where-to-get-the-tools-jar-to-use-with-the-java-8-jdk-early-release
I mentions about JDK not installed correctly
I have uninstalling Java 1.8 rebooted the machine..Installed it again - Still not able to launch using idea64.exe.
Nothing seems to help me so for.
Can you please let me know why tools.jar is missing and how can I get it?

0

Just installed from the same file and tools.jar is present:

http://i.imgur.com/XvlCTNP.png

Maybe it was removed by your antivirus?

0

I have uninstalled and installed Java 1.8 multiple times so for. I don't get tool.jar into  D:\Program Files\Java\jdk1.8.0_66\lib.
I am using Windows 7 64 bit ServicePack 1.
I have rebooted my machine serveral times. no luck so for.

0

This file is present in the default JDK installation, something on your system is probably removing it during install, it could be your antivirus detecting something suspicious in this file. Check your antivirus logs and quarantine folder.

0

Thanks for the pointer I will have a look.

0

Issue is resolved,
When I ran the installer it first asks for the JDK path I changed that from the default C: to D: (I don't want to install things into my C: since my C: has less free space).
After installing JDK the installer asks for JRE path. I changed that from the default C: to D: But accidently given the same path I gave for JDK. So I think that has caused this problem.
I created a seperate directory for JRE and everything is fine now..
Thanks for you help.

0

I have a similar issue on MAC. I have JDK installed and i have tools.jar. IntelliJ works fine, but CLions says that tools.jar is missing from JAVA_HOME, which is weird. I've explicitly set JAVA_HOME in my shell and retried (multiple times, through multiple shells), and its still the same.

I have installed the latest version of JDK8, and also reinstalled CLion (and even tried the early access of CLion 2018). None seem to help.

1

I got this to work for MAC. See details in comments here:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000029424--tools-jar-seems-to-be-not-in-CLion-classpath-but-JAVA-HOME-is-set-IntelliJ-works-fine-as-well-

 

Copying for easy reference:

Go to Applications -> Right click on CLion -> Show Package Contents -> jdk -> Contents -> Home -> lib

This folder was empty for me. So I copied over all the files from $JAVA_HOME/lib to this directory and started CLion. And now it seems to be working.

0

Struggling with the same. Followed the official instructions to create a Intellij IDEA plugin (https://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system/prerequisites.html) when I encountered the same.

For me, tools.jar was present in Applications > Right click on Intellij IDEA > Show Package Contents > jdk > Contents > Home > lib. I tried to copy in the rest from $JAVA_HOME/lib, without luck. For me, $JAVA_HOME is set to:

/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home

I have tried running gradle both in Intellij IDEA and directly the terminal, in both cases I get the same error:

JDK Required: 'tools.jar' seems to be not in IDEA classpath.
Please ensure JAVA_HOME points to JDK rather than JRE.

Can anyone shed some more light on this?

1

Hello,

Do you mean that you get the same error during Gradle build from command line (without IDE)?

0

Correct: from command line:

$ ./gradlew runIde
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :runIde
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=250m; support was removed in 8.0
JDK Required: 'tools.jar' seems to be not in IDEA classpath.
Please ensure JAVA_HOME points to JDK rather than JRE.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':runIde'.
> Process 'command '/Users/xxx/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbrex8u152b1136.39_osx_x64/jdk/Contents/Home/jre/bin/java'' finished with non-zero exit value 4
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 31s
8 actionable tasks: 2 executed, 6 up-to-date

From Intellij IDEA 2018.1 (Gradle menu > Tasks > intellij > runIde):

10:30:32: Executing task 'runIde'...

:compileJava UP-TO-DATE
:patchPluginXml UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:instrumentCode UP-TO-DATE
:postInstrumentCode
:jar UP-TO-DATE
:prepareSandbox UP-TO-DATE
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=250m; support was removed in 8.0

JDK Required: 'tools.jar' seems to be not in IDEA classpath.
Please ensure JAVA_HOME points to JDK rather than JRE.
:runIde FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':runIde'.
> Process 'command '/Users/xxx/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbrex8u152b1136.39_osx_x64/jdk/Contents/Home/jre/bin/java'' finished with non-zero exit value 4

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 25s
8 actionable tasks: 2 executed, 6 up-to-date
Process 'command '/Users/xxx/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbrex8u152b1136.39_osx_x64/jdk/Contents/Home/jre/bin/java'' finished with non-zero exit value 4
10:30:58: Task execution finished 'runIde'.

JAVA_HOME is set:

 $ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home

tools.jar is in JAVA_HOME subdirectory:

$ ls -l /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/tools.jar
-rw-r--r-- 1 root wheel 18291470 Mar 29 01:00 /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/tools.jar

tools.jar is also in the bundled jdk for Intellij IDEA:

$ ls -l /Applications/IntelliJ\ IDEA.app/Contents/jdk/Contents/Home/lib/tools.jar 
-rw-r--r-- 1 xxx admin 18307357 May 24 16:38 /Applications/IntelliJ IDEA.app/Contents/jdk/Contents/Home/lib/tools.jar

tools.jar is also in the cached jdk in gradle:

$ ls -l ~/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbrex8u152b1136.39_osx_x64/jdk/Contents/Home/lib/tools.jar 
-rw-r--r--  1 xxx  XXX\Domain Users  18307357 Aug 17 16:17 .gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbrex8u152b1136.39_osx_x64/jdk/Contents/Home/lib/tools.jar
0

What "org.jetbrains.intellij" plugin version do you use?

0

Yaroslav: 0.3.6. (Populated in build.gradle by new project > Intellij Platform Plugin, made available by the "Plugin DevKit" plugin)

0

Could you please try to downgrade to 0.3.5?

0

Yaroslav: That worked! A bug on your part then? 

0

Please sign in to leave a comment.