Maven compilation issue with Java 9

前端 未结 5 1562
独厮守ぢ
独厮守ぢ 2020-11-30 05:40

Trying to compile a Maven project using JDK 9.0.1 I\'m facing this stacktrace without much of an explanation:

Exception in thread \"main\" java.lang.Assertio         


        
5条回答
  •  执念已碎
    2020-11-30 06:02

    The part of the stack trace

    at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.readSourceFile(JavaCompiler.java:821)
    

    relates to the line of code

    throw new CompletionFailure(c, diags.fragment("cant.resolve.modules"));
    

    This would possibly happen when you're trying to build a maven module which is not based on Java9 and/or does not have(correct) module declaration module-info.java with a release version specified as 9 where it won't be able to resolve modules with/without the declaration.

提交回复
热议问题