Compile errors with JDK 9 - 167

2019-02-28 16:39发布

问题:

I just downloaded jdk9 build 167 and wanted to continue to check out the new module system. I did so already with a previous build (can't remember exactly which one). Now I installed the 167 and deleted the old JDK. When I try to compile now I get the error:

error: file should be on source path, or on patch path for module

If I remove the module-info.java (being in the root src path) it compiles fine. Anyone else having trouble here or did I miss something in the release notes ?

回答1:

You should try IntelliJ IDEA 2017.2 EAP 172.2103.15 from May 12, 2017, see: https://www.jetbrains.com/idea/nextversion/. You can Update from IntelliJ IDEA 2017.1.2 to IntelliJ IDEA 2017.2 EAP by selecting "Updates for: Early Access Program".