运行JUnit测试时,使用IntelliJ IDEA,我得到了

我怎么能纠正这个?
Maven构建工作正常.(这就是我在IDEA配置问题中相信这一点的原因)
我试图编译一些代码在我使用Intellij Ultimate 13.1.4,但我得到以下错误,我不知道这意味着什么:
Information:Using javac 1.7.0_55 to compile java sources
Information:java: Errors occurred while compiling module 'Example'
Information:Compilation completed with 1 error and 0 warnings in 3 sec
Information:1 error
Information:0 warnings
Error:java: invalid source release: 8
Run Code Online (Sandbox Code Playgroud)
我的猜测是它与Java 8和Java 7有关,但我不知道具体是什么.我试图谷歌周围的这个消息,但他们要么谈论javac或target release,所以它似乎并不完全适用.
为什么通过简单调用printf会出现以下编译错误?我的代码:
import java.util.Scanner;
public class TestCodeBankAccInputs
{
public static void main(String[] args)
{
String displayName = "Bank of America Checking";
int balance = 100;
System.out.printf("%s has %7.2f", displayName, balance);
}
}
Run Code Online (Sandbox Code Playgroud)
在编译时我收到以下错误:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method printf(String, Object[]) in the type PrintStream is not applicable for the
arguments (String, String, double)
at TestCodeBankAccInputs.main(TestCodeBankAccInputs.java:9)
Run Code Online (Sandbox Code Playgroud)
造成这种情况的原因是什么?如何解决?
在Eclipse中帮助 - >关于提供以下信息:
面向Web开发人员的Eclipse Java EE IDE.
版本:Indigo Release Build id:20110615-0604
我安装的JDK是JDK1.6.0_27
我已经看到有关String.format的类似问题.一些用户建议它可能是构建问题,但看起来我已经更新了版本.