简体   繁体   中英

How to setup SDK in IntelliJ IDEA?

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.

在此输入图像描述

I am working in this IDE for working on 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:

$ 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

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.

If you don't happen to have a JDK installed you can download the latest version here

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: 项目结构SDK设置

Alt + Ctrl + Shift + S - 项目

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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