gpt4 book ai didi

java - IntelliJ : scala: javac: invalid source release: 1. 7

转载 作者:太空宇宙 更新时间:2023-11-04 15:11:48 24 4
gpt4 key购买 nike

我最近将 Maven 项目升级到 Java 7。

我使用 IntelliJ,通过 Java 6,我可以在 IDE 中运行 JUnit 测试。这很方便,因为这是调试失败测试的快速方法。

自从升级到 7 后,当我尝试运行测试时出现以下错误:

scala: javac: invalid source release: 1.7
scala: Usage: javac <options> <source files>
scala: use -help for a list of possible options

我使用的是 OS X 10.8.5 和 IntelliJ 12.1.6。任何修复这些错误的帮助将不胜感激。

最佳答案

你的设置看起来像这样吗? UTF-8 1.6

...

        <plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.3</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<args>
<!--<arg>-unchecked</arg>-->
<!--<arg>-deprecation</arg>-->
<!--<arg>-explaintypes</arg>-->
</args>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>

关于java - IntelliJ : scala: javac: invalid source release: 1. 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21250550/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com