Enable Java 8 and Java 11 SDKs on Ubuntu

Install OpenJDK 8 and 11

$ sudo apt install -y openjdk-8-jdk openjdk-11-jdk

Set the environment variable JAVA_HOME

$ vi .bashrc
JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

bashrc update

$ source ~/.bashrc

Check the environment variable JAVA_HOME

$ echo $JAVA_HOME

Toggle java command version

sudo update-alternatives --config java

Switch between javac command versions

sudo update-alternatives --config javac

Recommended Posts

Enable Java 8 and Java 11 SDKs on Ubuntu
Install OpenJDK7 (JAVA) on ubuntu 14.04
Oracle Java 8 on Docker Ubuntu
Install Java on WSL Ubuntu 18.04
Run java applet on ubuntu
Enable Openjdk10 and maven on CentOS
Install JDK and JRE on Ubuntu 16.10
Java cannot be installed on Ubuntu 13.04
Notes on Java path and Package
Install Java 9 on windows 10 and CentOS 7
Installing and using Ansible on Ubuntu 16.04
Install OpenJDK (Java) on the latest Ubuntu
Build OpenCV with Java Wrapper on Ubuntu 18.04
Java and JavaScript
XXE and Java
tmux on Ubuntu
Install java and android-sdk on Mac using homebrew
Put Java 11 and spring tool suite on mac
Build and install Wireshark Development Release (3.3.1) on Ubuntu
Publish MySQL externally and log in on Ubuntu
Protobuf and gRPC C ++ environment construction on Ubuntu 18.04
[Java] Build Java development environment on Ubuntu & check execution
Build a DHCP and NAT router on Ubuntu 16.04
Install and switch between multiple Javas on Ubuntu
Docker on Ubuntu18.04 on WSL2 and VSCode installation instructions
Compile and run Java on the command line
On ubuntu, scilab, octave and R, sympy, etc.
Upload and download notes in java on S3
Screen recording on Ubuntu 20.04
Web Bluetooth on Ubuntu20.04
Let's touch on Java
Getters and setters (Java)
Try DisplayLink on Ubuntu 20.04
Reinstall Kubernetes on Ubuntu 19.10
Install Java on Mac
[Java] Thread and Runnable
Install pyqt5 on ubuntu
Java true and false
[Java] String comparison and && and ||
Run PostgreSQL on Java
Install Ruby on Ubuntu 20.04
Install java and maven using brew on new mac
I tried using YOLO v4 on Ubuntu and ROS
Java --Serialization and Deserialization
[Java] Arguments and parameters
Setting JAVA_HOME on Ubuntu
Install Autoware on Ubuntu 18.04.5
Put JetBrains on Ubuntu
Use mkdir on ubuntu
Install rbenv with apt on ubuntu and put ruby
[Java] Branch and repeat
Apache2 on Ubuntu20.04 LTS
Prepare the environment for java11 and javaFx with Ubuntu 18.4
Use cpplapack on ubuntu
ubuntu on wsl part 10
Install Homebrew on Ubuntu 20.04
Run tiscamera on Ubuntu 18.04
[Java] Variables and types
Build Zabbix on Ubuntu 20.04
java (classes and instances)
Talk about introducing Ubuntu 20.04 on Windows 10 and text editor