How to find Java JDK Path – OpenJDK ?
This tutorial guides you on how to find Java JDK path of OpenJDK that is installed in your Linux machine.
How to find Java JDK Path – OpenJDK
It is really simple to find the Java JDK path – OpenJDK path installed in your ubuntu machine. Nowadays the VM instances by default have JDK installed on it. For example. Google Compute Engine instances by default have OpenJDK installed.
Therefore, it may be necessary for you to check whether OpenJDK is installed or not. Also which version of Java is installed on your Ubuntu VM instance.
To find Java OpenJDK path in your Ubuntu machine, you need to run the following command from the command line or terminal.
$ sudo update-alternatives --list java /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
From the above output, it is evident that the OpenJDK 11 is installed on your machine. And the JDK path is “/usr/lib/jvm/java-11-openjdk-amd64”
To set JAVA_HOME with your OpenJDK path you need to execute the following export command from terminal. Therefore, you can use java environment to run Java based applications.
$ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
If you wanted to install OpenJDK on your ubuntu machine, then follow this tutorial: How to install OpenJDK 11 in Ubuntu Machine.
Finally, you can check Java Version by running the following command.
$ java -version openjdk version "11.0.9.1" 2020-11-04 OpenJDK Runtime Environment (build 11.0.9.1+1-post-Debian-1deb10u2) OpenJDK 64-Bit Server VM (build 11.0.9.1+1-post-Debian-1deb10u2, mixed mode, sharing)
That’s it. You have learnt how to find Java JDK path – OpenJDK installed on your ubuntu machine.
Hope it helped 🙂
- How to Start Stop Restart MariaDB on Linux OS ?
- How to set or change root password in Ubuntu Linux ?
- Putty Fatal Error No supported authentication methods available
- How to find which users belongs to a specific group in linux
- Give write permissions for specific user or group for specific folder in linux
- How to unzip a zip file from Terminal (Google Cloud Shell)
- Build a Docker Image with a Dockerfile and Cloud Build in GCP?
- How to create GCP project on Google Cloud Platform
- MariaDB – How to set max_connections permanently ?
- How to create GCP project on Google Cloud Platform
- Is it possible to change Google Cloud Platform Project ID ?
- Create non-root SSH user account and provide access to specific folders
- MySQL : How to grant all privileges to the user on database ?
- How to install OpenJDK 11 in Ubuntu Machine ?