Unable to compile java 9 project in IntelliJ IDEA with module information

Cannot compile java 9 project in IntelliJ IDEA with module information.

  • Create project
  • Add module
  • Create a class with the main one (without starting module-info.java)
  • Add Module-info.java
  • Run Home Failure

Configuration

enter image description here

Info module

module httpexample { }

Error

enter image description here

Error: (1, 1) java: the file must be on the source path or on the repair path for the module

Intellij version

IntelliJ IDEA 2017.1.2 Build #IU-171.4249.39, built on April 25, 2017 JRE: 1.8.0_112-release-736-b16 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains sro Mac OS X 10.11.1

+5
source share
3 answers

This seems to be a new issue caused by the 166 Java 9 update, I reported it to YouTrack, please follow the updates:

+8
source

I am using IntelliJ EAP 2017.2 build 1909.2 and this is no longer a problem

+1
source

I installed IntelliJ 2017.2 EAP and JDK 9 build 169 and opened my modular system projects and it works fine, now my system information:

IntelliJ IDEA 2017.2 EAP
Build # IU-172.2103.15, built May 12, 2017
IntelliJ IDEA EAP Users
Validity: June 11, 2017
JRE: 1.8.0_152-release-845-b3 x86_64
JVM: 64-bit OpenJDK virtual machine from JetBrains sro
Mac OS X 10.12.4

enter image description here

0
source

Source: https://habr.com/ru/post/1267358/


All Articles