VichynewSTB
VichynewSTB

Reputation: 41

IntelliJ won't recognize JDK on Ubuntu

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)

Upvotes: 0

Views: 1655

Answers (1)

Mirek Pluta
Mirek Pluta

Reputation: 8003

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

Upvotes: 3

Related Questions