0

I installed openjdk using the command:

sudo apt install openjdk-11-jre-headless

java -version command correctly displays the installed package

openjdk 11.0.15 2022-04-19
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1)
OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1, mixed mode, sharing)

However, when I open the IntelliJ IDEA environment, and want to run the first project, the environment does not detect the sdk

Should I configure something else beforehand, I haven't had much experience with Ubuntu before, for comparison in windows using the command -java version I get this message: completely different from what I get on ubuntu and everything works fine

java version "17" 2021-09-14 LTS
Java(TM) SE Runtime Environment (build 17+35-LTS-2724)
Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
VichynewSTB
  • 41
  • 1
  • 7

1 Answers1

3

That's because you've installed JRE instead of JDK. see: What is the difference between JDK and JRE?

Just try sudo apt install openjdk-17-jdk

Mirek Pluta
  • 7,883
  • 1
  • 32
  • 23
  • thanks for the answer, so it follows that I need the JDK, do I need to uninstall the JRE somehow (what I did earlier) or just run the command `sudo apt install openjdk-17-jdk` and everything will work fine? – VichynewSTB Jul 18 '22 at 18:05
  • 1
    Just install JDK. It's not the problem that you have this previously installed JRE – Mirek Pluta Jul 18 '22 at 18:06