简体   繁体   English

如何在IntelliJ IDEA中设置SDK?

[英]How to setup SDK in IntelliJ IDEA?

I am not finding any way to setup the SDK in IntelliJ IDEA. 我没有找到任何方法在IntelliJ IDEA中设置SDK。 Not finding any path to setup the SDK in ubuntu 16.04 LTS for IntelliJ IDEA. 找不到任何在ubuntu 16.04 LTS中为IntelliJ IDEA设置SDK的路径。

在此输入图像描述

I am working in this IDE for working on mongodb. 我正在使用这个IDE来处理mongodb。 But can't proceed because of this problem. 但由于这个问题无法继续。

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. 因此,该目录应在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. 您可以在Project Structure配置,按Ctrl + Alt + Shift + S ,选择Platform Settings -> SDKs ,单击绿色按钮(+) ,选择JDK的主目录。

If you don't happen to have a JDK installed 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/

And finally reference your new JDK on IntelliJ: 最后在IntelliJ上引用你的新JDK: 项目结构SDK设置

Alt + Ctrl + Shift + S - 项目

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM