downloaded intellij from ubuntu software it is working fine but when I type java -version on terminal the command java is not recognied pops up
Olivia Zamora
My intellij program works fine and runs programs as well but when I tried to check versions from terminal the terminal did not recognize "java" in "java -version" command. Also when I type javac it asks me to install jdk whereas the jdk is already installed. I started using ubuntu two days ago so I am not familiar with how this works. Thank you for the help.
The error message I get is given as follows
$ java --version
Command 'java' not found, but can be installed with:
sudo apt install default-jre # version 2:1.11-72, or
sudo apt install openjdk-11-jre-headless # version 11.0.8+10-0ubuntu1~20.04
sudo apt install openjdk-8-jre-headless # version 8u265-b01-0ubuntu2~20.04
sudo apt install openjdk-13-jre-headless # version 13.0.3+3-1ubuntu2
sudo apt install openjdk-14-jre-headless # version 14.0.1+7-1ubuntu1 8 Reset to default