March 29, 2018

How to find which flavor and which version of JDK do I have on my Ubuntu

Command to find the file containing the jdk information

Command:

file `which java javac`

Output:


~/ $ file `which java javac`
/usr/bin/java:  symbolic link to `/etc/alternatives/java'
/usr/bin/javac: symbolic link to `/etc/alternatives/javac'


Command to find the jdk version information

Command and Output


~/ $ file /etc/alternatives/java /etc/alternatives/javac
/etc/alternatives/java:  symbolic link to `/usr/lib/jvm/java-8-oracle/jre/bin/java'
/etc/alternatives/javac: symbolic link to `/usr/lib/jvm/java-8-oracle/bin/javac'
~/ $

Now, you are having Java/JDK version 8 of oracle.

No comments:

Post a Comment