[英]How can I switch the bytecode target level in IntelliJ using Maven 3 profiles
我正在使用maven配置文件在Intelli J中的两个“设置”之间切换。如何切换字节码目标级别? 那就是:我想在compiler.xml中更改以下设置
<bytecodeTargetLevel>
<module name="finmath-lib" target="1.6" />
</bytecodeTargetLevel>
注意:我尝试通过相应的Maven 3配置文件中的以下部分执行此操作
<profile>
<id>java-8</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</profile>
但这不起作用!
注意:pom.xml等属于finmath lib项目,如果您有兴趣,可以在www.finmath.net找到它。
我正在使用IntelliJ IDEA 14.1.3 ,它可以使用以下配置...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
希望这是有帮助的。 谢谢!
问题是您要将其更改为1.8。
我已经尝试使用Maven配置文件成功切换IntelliJ的编译器版本在1.7和1.6或1.5之间。
但是,当您要将其更改为1.8时,将忽略配置。
我不知道这是maven的问题还是Intellj的问题。 看来JDK 1.8现在得不到很好的支持,这是可以理解的。
您可以在IntelliJ中打开Maven项目工具窗口,然后从列表中选择要使用的配置文件。
在IntelliJ 13, File > Project Structure
,将Project language level
设置为8.0。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.