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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 02:55:40  来源:igfitidea点击:

Error running: Project has no JDK configured in IntelliJ IDEA Ultimate

javaintellij-ideasettings

提问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 Structurepresent under Filemenu or use shortcut ctrl+alt+shift+S

1)Project StructureFile菜单下打开礼物或使用快捷方式 ctrl+alt+shift+S

2) SDKsis 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 Applyand OK.

3) 设置JDK 主目录路径(例如:/usr/lib/jvm/java-1.8.0-openjdk-amd64)并单击ApplyOK

You should be able to execute your program now.

您现在应该可以执行您的程序了。

enter image description here

enter image description here

回答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 然后单击应用然后确定,您的项目现在应该运行。