A
A
Arti-Jack2016-09-28 13:54:31
Java
Arti-Jack, 2016-09-28 13:54:31

How to properly set up Intelij IDEA on Ubuntu?

Good day.
There was a small issue that I've never had before: jdk loading issue in ideas.
Loaded java through the terminal - everything loaded (for the sake of verification, I compiled the class in the terminal).
I downloaded the idea and uploaded it. When specifying the JDK, the path was set: /usr/lib/jvm/java-8-oracle , but the idea does not recognize this path as necessary.
The question arises: Where then is the desired JDK folder, if the JDK itself was downloaded through the terminal using the following commands?

sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

PS: I'm new to Linux, so please understand me correctly.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Victor Alenkov, 2016-09-28
@Borz

IDEA uses its JDK by default, which is located in $IDEA_HOME/jre. In the latest versions, this is initially Oracle Java 8.
But for projects, you need to specify the required JDK through the project settings (File> Project Structure> Project> Project SDK)

M
Mikhail Osher, 2016-09-28
@miraage

sudo apt-get install oracle-java8-set-default

O
Oleg Tsilyurik, 2016-09-28
@Olej

When specifying the JDK, the path was set: /usr/lib/jvm/java-8-oracle

JDK (Java Development Kit) and JRE (Java Runtime Environment) are not the same thing (JDK includes JRE).
If you are unsure why you need the Sun/Oracle JDK, you don't need to install anything and use the OpenJava JDK that you have in your default distribution .
If you know the installation path of your java and javac, you can define environment variables to use by default:
export JAVA_HOME=/opt/oracle/jdk1.8.0_05
export JDK_HOME=$JAVA_HOME

You can read here: JDK & OpenJDK .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question