I have both OpenJDK and Oracle Java installed on my Ubuntu. If the activated java is OpenJDK, is there a way to check the version of Oracle java in bash shell
If you are using the openjdk java, then the oracle Java in your PC is just a folder. There is no command to check the version of that if you are not using it.
If you once used oracle java then it must be in your java alternatives and you can find the folder (usually with version in name) with:
update-alternatives --config java
If it says something like /usr/lib/jvm/jdk1.8.0_05/bin/java, then you have 1.8 in your pc.
If you haven't used oracle java anytime you simply have to check what you have downloaded.
If you want to simply see the version you are using:
java -version
Hope it helps