我已将 Module SDK 设置为 1.6
I have set the Module SDK to 1.6
我还将 Project SDK 设置为 1.6
I have also set the Project SDK to 1.6
我还将 Java 编译器选项从设置更改为使用 java 6
and I also change Java compiler options from setting to use java 6
但它仍然使用 java 7 进行编译.当我编译或运行时,它会出现以下错误
but still it is using java 7 to compile. When I compile or run it gives following error
Using javac 1.7.0_11 to compile java sources
java: Errors occurred while compiling module 'SSLJava6'
Compilation completed with 1 error and 0 warnings in 1 sec
1 error
0 warnings
java: javacTask: source release 1.7 requires target release 1.7
以前有人遇到过这样的问题吗?必须做什么?
Has anyone faced such problem before? What must be done?
java -version
的输出
[aniket@localhost jndiProperties]$ java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
我的 JAVA_HOME
也设置为相同.
and my JAVA_HOME
is also set to same.
有趣.
问题:
c:Users$user.IntelliJIdea12configoptionsjdk.table.xml
是否仅引用了 JDK6.<jdk>
元素并重新启动 Intellij.java
和javac
路径.通过在一个全新的 Intellij 项目中编写一个简单的 HelloWorld.java 来确认正在使用的 javac.HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment
mklink/J c:Java7Home c:ExistingJava6Home
c:Users$user.IntelliJIdea12configoptionsjdk.table.xml
has a reference to JDK6 only. <jdk>
element and restart Intellij.java
and javac
path. Confirm the javac being used by writing a simple HelloWorld.java in a brand new Intellij project.HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment
mklink /J c:Java7Home c:ExistingJava6Home
这篇关于Intellij IDEA 使用 java7 编译器编译时我已将其配置为使用 Java6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!