Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

intellij - java: Cannot find JDK '1.7' for module

I've just installed IntelliJ on Windows 8 (and 7). I then use the 'Java Hello World' Sample as my project.

I then selected the JDK that was installed (C:Program FilesJavajdk1.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'

No matter what I do I cannot compile any Java code under Windows8/IntelliJ

I have tried the following:

  • 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 FilesJavajdk1.7.0_10)

I'm lost as to why this is happening.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
project structure > project > choose correct jdk

or ctrl+alt+shift+s > project> choose correct jdk

also platform settings > SDK's >and make sure 1.7 is there.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...