Java 如何在 IntelliJ IDEA 中设置 SDK?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43661829/
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
How to setup SDK in IntelliJ IDEA?
提问by Soumen Pasari
I am not finding any way to setup the SDK in IntelliJ IDEA. Not finding any path to setup the SDK in ubuntu 16.04 LTS for IntelliJ IDEA.
我没有找到在 IntelliJ IDEA 中设置 SDK 的任何方法。在 ubuntu 16.04 LTS for IntelliJ IDEA 中找不到任何设置 SDK 的路径。
I am working in this IDE for working on mongodb. But can't proceed because of this problem.
我在这个 IDE 中工作是为了处理 mongodb。但是因为这个问题无法继续。
采纳答案by JUAN CALVOPINA M
To find the path where java is installed on ubuntu, you can run the following command from terminal:
要查找 ubuntu 上安装 java 的路径,可以从终端运行以下命令:
$ whereis java
You may get something like this:
你可能会得到这样的东西:
java: /usr/bin/java /etc/java /usr/share/java /usr/lib/jvm
Which means that the java resides at one of the above paths as for example /usr/bin/java
这意味着 java 驻留在上述路径之一,例如 /usr/bin/java
So, that directory should designate in IntelliJ. You can configure in the Project Structure
, press Ctrl + Alt + Shift + S
, choose Platform Settings -> SDKs
, click on green button (+)
, select the home directory for JDK.
因此,该目录应该在 IntelliJ 中指定。您可以在 中配置Project Structure
,按Ctrl + Alt + Shift + S
,选择Platform Settings -> SDKs
,单击绿色按钮(+)
,选择 JDK 的主目录。
回答by NikSa
Alt+ Ctrl + Shift + S - Project
Alt+ Ctrl + Shift + S - 项目
回答by Danilo Teodoro
If you don't happen to have a JDKinstalled you can download the latest version here
如果你没有安装JDK,你可以在这里下载最新版本
You can unpack it to your home directory so that you don't need extra permissions:
您可以将其解压缩到您的主目录,这样您就不需要额外的权限:
~/Downloads$ tar zxvf jdk-<version>-linux-x64.tar.gz -C ~/java/jdk/