IntelliJ - Build artifact for a different Java target

To make IntelliJ generate your artifact for a different Java target than your current compiler (e.g. I use Java 8 but I want to generate a JAR compatible with Java 7), there's really not a homogeneous configuration. You cannot specify this in the Artifacts window, and also, and in my opinion this is a big flaw that needs to be fixed, the window I usually use to select the language level for the project (Project Structure > Project Settings > Project > Project language level) is of no use. To specify which target you want, you have to go to Settings > Build, Execution, Deployment > Compiler > Java Compiler and finally change the field "Project bytecode version". You can also specify a different version per module here. This is just confusing.


Popular Posts