Home > Mobile >  Intellij ignores java Compiler additional compiler options
Intellij ignores java Compiler additional compiler options

Time:02-11

I have a java 11 project which has some native functions. I am trying to generate the corresponding Header-files by adding '-h myDir' to the additional compiler options in Intellij but it seems like IntelliJ does not even look for those.

I am going to: Files > Setting > Build,Execution,Deployment > Compiler > Java Compiler > Additional Command line parameter

Can someone tell me what i am doing wrong.

CodePudding user response:

Fixed my own problem.

Since Intellij ignored the compiler options for my jdk11 project via Files > Setting > Build,Execution,Deployment > Compiler > Java Compiler > Additional Command line parameter I simply set them in gradle.build and it now runs perfectly.

In your gradle.build include following:

compileJava {
    options.compilerArgs  = ['-h', 'absolute dir where you want to put the header files']
}
  • Related