Modules and source path

已回答

Hello, i try to understand the modules, i have created my modules, each one has its own content root, its dependencies, there is no warning anywhere, all is clear or almost; but when i compile i have always the same error for each file (*-info.java included):

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

Additionally when i use the intellij's annotations i have equally this error:

'java: module not found: annotations.java'

'requires annotations.java;' line in module-info, but the 'annotation-java8.jar' dependency is present in the dependencies of each module.

It's a global problem thus i assume that the solution is obvious, but i don't find it...

0

Did you check https://blog.jetbrains.com/idea/2017/03/support-for-java-9-modules-in-intellij-idea-2017-1/ and the related examples?

Maybe you could share a sample project that doesn't work for you so that we can verify the configuration?

What JDK 9 build do you use? What's your IntelliJ IDEA version?

0

JDK 9-ea+168

IntelliJ IDEA 2017.1 Build #IC-171.3780.107
JRE: 1.8.0_112-release-736-b13 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux

I have exactly the same problem with an empty project, one module and one class.

It's a library thus i don't use a main class, neither a run configuration, i just use Build project.

 

0

Try 2017.2 EAP: https://www.jetbrains.com/idea/nextversion/.

There were some changes in the recent JDK 9 EA build which has broken compilation in IntelliJ IDEA: https://youtrack.jetbrains.com/issue/IDEA-172212.

0

The JDK 9-169 solves the source path, but i have always a problem with the annotations, even on 2017.2.

Without annotations it works.

0

请先登录再写评论。