java 运行出错:IntelliJ IDEA Ultimate 中项目没有配置JDK
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37900005/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error running: Project has no JDK configured in IntelliJ IDEA Ultimate
提问by warda hamk
When I try to execute program ergo, it gives me an error.
当我尝试执行程序 ergo 时,它给了我一个错误。
Error running: Project has no JDK configured
运行出错:项目没有配置JDK
Can anybody help me? I'm newbie in IntelliJ IDEA.
有谁能够帮我?我是 IntelliJ IDEA 的新手。
回答by learner
1) Open Project Structure
present under File
menu or use shortcut ctrl+alt+shift+S
1)Project Structure
在File
菜单下打开礼物或使用快捷方式 ctrl+alt+shift+S
2) SDKs
is located under Platform Settings
. Select it and click the green + up the top of the window.
2)SDKs
位于Platform Settings
. 选择它并单击窗口顶部的绿色 +。
3) Set JDK home directory path (e.g.: /usr/lib/jvm/java-1.8.0-openjdk-amd64) and click on Apply
and OK
.
3) 设置JDK 主目录路径(例如:/usr/lib/jvm/java-1.8.0-openjdk-amd64)并单击Apply
和OK
。
You should be able to execute your program now.
您现在应该可以执行您的程序了。
回答by evance masemola
open File -> Project Structure, under project SDK, where it says no JDKselect dropdown and check if they are any JDKs available, select available JDK then click Apply then OK, your project should run now.
打开文件 -> 项目结构,在项目 SDK 下,它说没有 JDK选择下拉列表并检查它们是否有任何可用的 JDK,选择可用的 JDK 然后单击应用然后确定,您的项目现在应该运行。