intellij - java:找不到JDK'1.7'的模块 [英] intellij - java: Cannot find JDK '1.7' for module
问题描述
我刚刚在Windows 8(和7)上安装了IntelliJ。然后我使用'Java Hello World'样本作为我的项目。
I've just installed IntelliJ on Windows 8 (and 7). I then use the 'Java Hello World' Sample as my project.
然后我选择了已安装的JDK(C:\Program Files \ Java \ _ddk1 .7.0_10)。项目创建成功,我可以看到与项目相关的所有类等。当我制作项目时,我收到以下错误:
I then selected the JDK that was installed (C:\Program Files\Java\jdk1.7.0_10). Project creates successfully and I can see all the classes associated with the project etc. When I "make the project" I get the following error:
Compilation completed with 1 error and 0 warnings in 2 sec
1 error
0 warnings
java: Cannot find JDK '1.7' for module 'TEST'
无论我做什么,我都无法在Windows8 / IntelliJ下编译任何Java代码
No matter what I do I cannot compile any Java code under Windows8/IntelliJ
我尝试过以下方法:
- 缓存无效。
- 切换到32位JDK而不是64位
- Idea64.exe而不是idea.exe
- 安装1.6因为这是1.7问题??
- 将JAVA_HOME更改为指向不同版本(即当前C:\Program Files \ Java \ _ddk1.7.0_10)
- Invalidating cache.
- Switching to 32bit JDK instead of 64bit
- Idea64.exe instead of idea.exe
- Installing 1.6 incase it was a 1.7 issue??
- Changed the JAVA_HOME to point to different versions (ie currently C:\Program Files\Java\jdk1.7.0_10)
我很遗憾为什么会发生这种情况。
I'm lost as to why this is happening.
推荐答案
找到问题的根源。原来,Windows 8下的Windows 8与OSX共享相同的桌面。这有点混淆IntelliJ,因此它无法正确编译。
Found the root of the problem. Turns out Windows 8 under parallels shares the same Desktop as OSX. This confused IntelliJ somehow and as a result it couldn't compile properly.
通过删除在配置下共享的桌面,可以解决问题。
In parallels by removing the "Desktop" shared under Configure this then resolves the issue.
这篇关于intellij - java:找不到JDK'1.7'的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!