我从Java 6升级到Java 8
。
根据these instructions,/Applications/IntelliJ IDEA 13 CE.app/Contents/Info.plist
我改变了
<key>JVMVersion</key>
<string>1.6*</string>
到
<key>JVMVersion</key>
<string>1.8*</string>
我的环境变量JAVA_HOME设置为:
/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home
但是,当我在IntelliJ中运行调试器时,它仍然想要使用Java 6:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java ...
Connected to the target VM, address: '127.0.0.1:60490', transport: 'socket'
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/my/MainClass : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
为了让IntelliJ使用Java 8 JRE,我需要更改哪些其他设置?
答案 0 :(得分:2)
您更改了IDE的设置。可以在此处更改项目设置:File->ProjectStructure->Project SDK