Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use -parameters javac option in intellij?

Tags:

I have this all working in eclipse and am trying to do so in intellij now. I opened settings {command and comma} then went to Build, Execution and Deployment and clicked Compiler and in Shared Build Process VM Options I typed in "-parameters" but intellij errored out when I built the project with "Unrecognized option: -parameters"

My project is compiling fine in jdk8 and I am using jdk 8 lambdas and other jdk features. I don't get why I can't get my code compiled with parameters build in.

like image 425
Dean Hiller Avatar asked Aug 30 '16 02:08

Dean Hiller


People also ask

Does IntelliJ use Javac?

IntelliJ IDEA doesn't run javac , therefore you can't see the command line. Compiler API is used directly from Java code. If you enable debug logging for build. log file, you may find some more details how the modified and dependent files are compiled and what options are used.

How do I compile in IntelliJ?

Select a module or a project you want to compile and from the main menu, select Build | Build Project ( Ctrl+F9 ). IntelliJ IDEA displays the compilation results in the Review compilation and build output.

How do I enable preview features in IntelliJ?

If you want to use preview features in the latest versions of Java in IntelliJ IDEA, you need to set the language level to "Preview". Go to Project Structure, ⌘; (macOS) or Ctrl+Alt+Shift+S (Windows/Linux), make sure you have the correct JDK selected, and pick the "Preview" option from the Language Level dropdown.


1 Answers

The "Shared build process VM options" field, as its name implies, is used to specify the VM options for the shared build process. The shared build process is not javac, and -parameters is not a VM option. Therefore, the option is not recognized.

The correct place to enter the -parameters option is Settings > Build, Execution, Deployment > Compiler > Java Compiler > Additional command line parameters.

like image 183
yole Avatar answered Oct 04 '22 18:10

yole