How to check Oracle Java version if multiple versions of Java installed on Ubuntu

后端 未结 5 1357
感情败类
感情败类 2021-02-07 10:46

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

5条回答
  •  你的背包
    2021-02-07 11:26

    you should follow bellow two commands

    1. sudo update-alternatives --config java

    In their show the all already installed Java versions like below

    2.gedit ~/.bashrc

    `export JAVA_HOME=/path/to/jdk/folder

    usually /usr/java/jdk or /usr/lib/java/jdk

    export PATH=$PATH:$JAVA_HOME/bin`

    add to bash

提交回复
热议问题