IDEA plugin dev: tools.jar not found

Answered

Hi,

I create a plugin project for intellij using intellij. Then Run it,
I get an error in the console:

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

and the same error as an ugly Java modal.

I use the `IntelliJ IDEA IU-171.4249.4` SDK that is created by intellij, I tried to add the tools.jar directly (last line in the last screenshot).

What is missing?

 

I'm on macos 10.12.4 (16E195)

IntelliJ IDEA 2017.1.2 EAP
Build #IU-171.4249.4, built on April 12, 2017

...
JRE: 1.8.0_112-release-736-b16 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.4

 

Bests,

0
7 comments

tools.jar has to be added to the "IDE SDK" classpath in your case.

Try using a standalone JDK outside of IntelliJ IDEA installation directory.

0

I added tools.jar to the IDE SDK, no change.

If I use another SDK I get a "Run Configuration Error: Wrong SDK type for plugin 'my-plugin'".

 

Thanks for looking into this Serge.

0

Please show the classpath of the "IDE SDK" configuration.

0

No change with an external tools.jar either,
"JDK Required: 'tools.jar' seems to be not in IDEA classpath.
Please ensure JAVA_HOME points to JDK rather than JRE."



0

Use standalone JDK installation for IDE SDK (not inside IntelliJ IDEA directory).

You can get one from https://bintray.com/jetbrains/intellij-jdk/ or use the standard Oracle JDK.

Make sure it's JDK and not JRE.

In the plug-in run/debug configuration the same JDK has to be used.

Sample configuration:

As you can see, the standalone 1.8 JDK is used, not JDK from the IntelliJ IDEA installation like on your screenshots (IDE SDK).

1

Go it, it's working now, thanks Serge!

0

Please sign in to leave a comment.