Using Intellij IDEA with current JDK

David Lloyd david.lloyd at
Wed Jan 17 17:47:37 UTC 2018

What I've done is to force no JDK at all.  It does present an ugly
banner[1] at the top but otherwise it seems to work fine - or did,
until the latest update[2].  If you've already set up a SDK, I think
there's no way to unset it, so you have to close IDEA, edit your
xxx.ipr or .idea/modules.xml (I think) and delete the line which
defines the SDK.

[1] See also:
[2] The error I see at present is of the type "Package 'java.lang' is
in the unnamed module, but module 'jdk.compiler' does not read it".
Previously I had excluded from all source roots, but
the latest update somehow determines that everything are Java 9
modules anyway.  I had done this for two reasons: firstly, there are
not module descriptors in every place where there are sources (for
example, having a separate "java.base:share" and "java.base:unix" IDEA
module causes problems because :share has a but :unix
does not), and secondly, IDEA does not cope well with situations where
there is more than one (for example if one is
generated from the other) or if it is simply generated to begin with.

On Wed, Jan 17, 2018 at 10:15 AM, Andrew Haley <aph at> wrote:
> I now always get "The selected directory is not a valid home for JDK".
> when selecting the JDK home directory.
> Does anybody have any idea how to persuade IDEA that we need to work
> on the current top-of-tree JDK?  Thanks.
> --
> Andrew Haley
> Java Platform Lead Engineer
> Red Hat UK Ltd. <>
> EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the jdk-dev mailing list