How to check the installed JDK on Ubuntu

How to check the installed JDK in ubuntu or raspbian?


You can use the following command:

sudo update-alternatives –config java

To view, you can also use

sudo update-alternatives -config javac is the same.

The system will display the path of the installed JDK

There are 3 choices for the alternative java(providing /usr/bin/java).

 Selection    Path                                            Priority   Status
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      auto mode
 1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      manual mode
 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode
 3 /usr/lib/jvm/java-8-oracle/jre/bin/java          1081      manual mode

Press <enter> to keep the current choice[*], or type selection number:

If only one JDK is installed in the operating system, it will be displayed as

root@raspberrypi:/usr/lib/jvm# update-alternatives --config java
There is only one alternative in link group java(providing /usr/bin/java):/usr/lib/jvm/java-11-openjdk-armhf/bin/java
Nothing to configure.
root@raspberrypi:/usr/lib/jvm#

You can use the path /usr/lib/jvm/default-java to set your default JDK HOME path, so no matter how you adjust the default JDK, you can ensure that you can use the default JDK in the operating system.

After running the ls -alht command, we can see that the system has set default-java through ln connection.

https://www.cwiki.us/questions/57938466

Recommended Posts

How to check the installed JDK on Ubuntu
How to modify the hostname on Ubuntu 20.04
How to run the parsing server on Ubuntu 14.04
How to install the latest MySQL on Ubuntu 18.04
How to add the gzip module to Nginx on Ubuntu 14.04
How to install jdk1.8 on centOS7
How to install Ruby on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to install Anaconda3 on Ubuntu 18.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install KVM on Ubuntu 18.04
How to install KVM on Ubuntu 20.04
How to install opencv3.0.0 on ubuntu14.04
How to install Prometheus on Ubuntu 16.04
How to install Jenkins on Ubuntu 18.04
How to deploy Django on Ubuntu 14.04
How to install R on Ubuntu 20.04
How to install Moodle on Ubuntu 16.04
How to install Solr 5.2.1 on Ubuntu 14.04
How to install Teamviewer on Ubuntu 16.04
How to secure Nginx on Ubuntu 14.04
How to install MariaDB on Ubuntu 20.04
How to install Nginx on Ubuntu 20.04
How to install Mono on Ubuntu 20.04
How to install Go on Ubuntu 20.04
How to uninstall software on Ubuntu
How to install Nginx on Ubuntu 16.04
How to install OpenCV on Ubuntu 20.04
How to install Spotify on Ubuntu 20.04
How to install Postman on Ubuntu 18.04
How to install Go 1.6 on Ubuntu 16.04
How to install Go on Ubuntu 18.04
How to install MySQL on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 20.04
How to install VLC on Ubuntu 18.04
How to install TeamViewer on Ubuntu 20.04
How to install Webmin on Ubuntu 20.04
How to set or modify the time zone on Ubuntu 20.04
How to set or modify the time zone on Ubuntu 20.04
How to install JDK and Mysql on Ubuntu 18.04 linux system
How to add swap space on Ubuntu 20.04
How to install Docker Compose on Ubuntu 18.04