java: Cannot find JDK '1.8'

Update: Not sure why this is marked as a duplicate. I had already linked to the other post stating that none of the suggestions / answers work for me. In addition, their question seems to be related to an issue using Windows VMs via Mac, which is irrelevant for me.

I am using IntelliJ IDEA 14.0.3. I have selected the 'Java Hello World' sample. When I try and run the program I receive the error: "Error: java: Cannot find JDK '1.8' for module 'Deliverable4'. I have tried every single suggestion from this post intellij - java: Cannot find JDK '1.7' for module but still can't this to work. Any help would be greatly appreciated.


Go to:

File => Project structure

And check: Project , Modules and SDKs tabs:

在这里输入图像描述

If at SDKs Java 1.8 Sdk isn't selected just add it.

And press OK .


从IntelliJ版本14.0.3更新到14.1似乎解决了这个问题。


If the update solution given above doesn't work for somebody, consider not using the bin directory like the one used in the PATH environment but rather the java root directory. In short instead of:

path_to_java_folderjavabin

use:

path_to_java_folderjava

and everything will work just fine.

链接地址: http://www.djcxy.com/p/72788.html

上一篇: IntelliJ不会在List / Map的末尾接受Java8和钻石

下一篇: java:找不到JDK'1.8'