How to setup SDK in IntelliJ IDEA?
30,417
Solution 1
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.
Solution 2
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:
Author by
Soumen Pasari
Exploring and learning new things in both IT world and the real world that I live in.
Updated on April 28, 2020