Setting a JAVA HOME Path in Ubuntu
1. Install
sudo apt-get install openjdk-11-jdk2. Check the version
chloe@chloe-XPS-15-9570 ~
$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)3. Find where JDK is installed
chloe@chloe-XPS-15-9570 ~ $ cd /usr/lib/jvm/ chloe@chloe-XPS-15-9570 /usr/lib/jvm $ ls default-java java-11-openjdk-amd64 java-8-openjdk-amd64 java-1.11.0-openjdk-amd64 java-1.8.0-openjdk-amd64 openjdk-11
4. Set environment variable
5. Check the environment variable
5-1. Check the configured environment variable using the echo command
echo command5-2. Check using the printenv command
printenv commandWhen you want to switch between alternatives and build with a specific version
Last updated