Exporting a package from system module is not allowed with --release

前端 未结 5 1727
迷失自我
迷失自我 2021-01-02 03:15

I have the following program:

module-info.java

module a {
}

Main.java

public clas         


        
5条回答
  •  星月不相逢
    2021-01-02 03:37

    If you are using IntelliJ idea, try checking your Java compiler settings:

    Go to the File menu -> [Settings] -> [Build, Execution, Deployment] -> [Java Compiler] and check the setting "Project bytecode version". I got a similar error ("exporting a package from system module java.datatransfer is not allowed with --release") when using JDK 11 while this value was still set to version 9. Setting it to 11 fixed the problem for me.

提交回复
热议问题