To know the installed version you can type the command javac/java with the option -version:
$ javac -version
$ java -version
To check where is the installed path, use the which command:
$ which javac
$ which java
It's a personal blog/note/bookmark of a idiot in Linux.