Using local OpenJDK build as SDK
Answered
Hi,
I have cloned and built (with "make images") a local OpenJDK ("amber" repository). When I try to add the resulting build//images/jdk directory as an SDK, IntelliJIdea does not complain about the directory structure (so it correctly identifies it as a modular JDK), but the Classpath tab is blank, so the resulting configuration is unusable. If I manually add the JDK modules at build//images/jdk/jmods, they show up as ordinary files and are not scanned as module files.
I assume this works for other people, so what am I doing wrong? Wrong build target? Wrong JDK directory? (Note that I am not trying to start IntelliJIdea with an OpenJDK build, just use my local build as a project JDK.)
Thanks,
Robert
Please sign in to leave a comment.
Please try with 2017.3 from https://www.jetbrains.com/idea/nextversion/ If does not help, please post content of idea.log file starting from IDE restart and reproducing the problem.
Hi Andrey,
I should have said, I'm already using the latest EAP build. There is nothing written in the idea.log file when I add an SDK (and no errors on the screen).
The SDK is correctly identified as a JDK 10 build, the Sourcepath is found as build/<platform>/images/jdk/lib/src.zip!/java.se (etc.), but I'm 'just' missing the Classpath
What OS do you use? https://youtrack.jetbrains.com/issue/IDEA-179481 may be the case.
Same problem on both my Windows 7 and OS X (with a clone of the same repository, http://hg.openjdk.java.net/amber). I'll have a look with the utility linked in the bug.
Hi Robert,
I tried to create a JDK from a fresh build of Amber repository, and got the following in the log:
The problem is the same as in IDEA-179481 - since the IDE is unable to load lib/jrt-fs.jar, it can't enumerate the modules.
Substituting lib/jrt-fs.jar with the one copied from JDK 9 fixes the exception. Unfortunately, a negative result is already cached, so one has to delete the incomplete JDK definition, perform File | Invalidate Caches, and restart the IDE. Adding a JDK should work after that.
Yes, that was it, thanks. I didn't see the error messages in my log because the bad results were already cached from earlier attempts.