简体   繁体   中英

Target bytecode always drop back to 1.5 in IntelliJ

I have a collection of "Samples" projects. The toplevel project is empty, while it contains a lot of modules.

Unfortunately, I am often required to set target bytecode to 1.5.

I did that many times from the beginning of the project, but it still drops back to 1.5.

How to stuck with 1.8 forever?

在此处输入图片说明

You can use this in your pom:

( https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html )

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.6.1</version>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>
    </configuration>
  </plugin>

我的情况(RHEL 7,IntelliJ 2019.3.1)的问题是缺少环境变量JAVA_HOME

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM