6

I am working on one project in IntelliJ IDEA. I loaded it from a github repository (Check out from version control on the splash screen-> git -> paste the url). I have no errors in my code, but when I try to compile I get the following message:

Error:java: exporting a package from system module jdk.compiler is not allowed with --release

I'm a beginner in working with Intellij, and I have no idea what this message means. Any help? I am using JDK 11

Ibrahim7
  • 113
  • 2
  • 7
  • Without knowing what the program you downloaded is I have to guess here: is your issue related to https://stackoverflow.com/questions/45370178/exporting-a-package-from-system-module-is-not-allowed-with-release ? – fvu Oct 30 '18 at 00:06
  • @fvu Thanks, I saw that question but I don't understand what is --release or --add-exports. Also, I am not running my program from command prompt but inside IntelliJ IDEA. – Ibrahim7 Oct 30 '18 at 00:14
  • IntelliJ will run the javac **compiler** (not program, this is a compilation error). And `--release` and `--add-exports` add flags passed to the compiler, but they cannot be combined it seems. That's about all I can tell you based on your question. – fvu Oct 30 '18 at 00:25

2 Answers2

15

File > Settings > Java Compiler

Uncheck the button next to "Use 'release' option...

enter image description here

smac89
  • 39,374
  • 15
  • 132
  • 179
2

In Intellij IDEA Go to File >> Settings >> Build,Execution,Deployment >> Compiler >> Java compiler and Uncheck "Use 'release' option for cross-compilation..."