How to know that Java is installed in a Linux system?

I am using Ubuntu. How to know if Java is installed ?


In your terminal type java -version or just javac if it returns something, then you've java installed. Otherwise, there is also the possibility that the path variables do not contain the java path. So use locate jdk or locate java to see if you have the java binary. Don't forget to run updatedb if you are using locate for the first time.


You should be able to run which java or java -version.