How to build Java environment on Ubuntu (Linux)

TL;DR It is recommended to use SDKMAN when building a Java environment on Ubuntu. It is possible to install Java via apt, but it is difficult to select and switch versions by yourself. In addition, tools such as gradle require time and effort such as adding a repository. With SDKMAN, you can easily install multiple versions of Java (and Java-related tools) and switch between versions.

Installing SDKMAN

Follow the Official Site Installation Procedure. First, execute the following command. SDKMAN will be downloaded and installed. curl -s | bash After the installation is complete, open a new terminal and pass the path to SDKMAN with the following command. (You only need to execute it once. There is no need to describe it in .bashrc etc.) source" /home/username/.sdkman/bin/ "

Use the following command to check if the installation was successful. If the version is displayed, the installation is successful. sdk version

Java installation

First, check the Java that can be installed with the following command. sdk list java Install as follows. (Example: Install Java 11 (LTS) of Adopt OpenJDK) sdk install java If you want to install another version of Java, install it in the same way. sdk install java 14.0.2.hs-adpt

Java tool installation

Java tools such as Ant, Maven and Gradle can also be installed with SDKMAN. For example, when installing Gradle, install it with the following command like Java. sdk list gradle sdk install gradle 6.8

Reference site

-Manage multiple JDKs with SDKMAN

Recommended Posts

How to build Java environment on Ubuntu (Linux)
[Latest] How to build Java environment on Ubuntu
How to build a Python environment on amazon linux 2
How to build a new python virtual environment on Ubuntu
How to install php7.4 on Linux (Ubuntu)
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
How to build a Django (python) environment on docker
How to install VMware-Tools on Linux
How to install MBDyn (Linux Ubuntu)
Build Python 3.8 + Pipenv environment on Ubuntu 18.04
How to install Go on Ubuntu
A memo on how to easily prepare a Linux exercise environment
How to create a Python 3.6.0 environment by putting pyenv on Amazon Linux and Ubuntu
Memo A beginner tried to build a Java environment and Japaneseize it on Ubuntu 18.04.2 LTS.
How to build my own Linux server
How to build a sphinx translation environment
Build Python3 and OpenCV environment on Ubuntu 18.04
How to build Hello, World on #Nix
How to update php on Amazon linux 2
Steps to install Python environment on Ubuntu
Build an LNPP environment on Amazon Linux 2
How to display emoji on Manjaro Linux
How to install packages on Alpine Linux
How to install Anisble on Amazon Linux 2
How to update security on CentOS Linux 8
On Ubuntu Linux, set Tab to q
How to find large files on Linux
Shell script to build pyenv environment on ubuntu in one shot
Strategy on how to monetize with Python Java
Build python environment with pyenv on EC2 (ubuntu)
Build Python3.5 + matplotlib environment on Ubuntu 12 using Anaconda
How to run MeCab on Ubuntu 18.04 LTS Python
How to update security on Ubuntu 19.10 Eoan Ermine
Build a Kubernetes environment for development on Ubuntu
How to install Camunda Modeler on Manjaro Linux
[TF] How to build Tensorflow in Proxy environment
Build Linux on a Windows environment. Steps to install Laradock and migrate
Build an Arch Linux environment on Raspberry Pi
How to build an environment for using multiple versions of Python on Mac
[Linux] How to read .bashrc of general user as root user on WSL2 Ubuntu20.04
# 2 Build a Python environment on AWS EC2 instance (ubuntu18.04)
How to use C216 Audio Controller on Arch Linux
How to install Linux on a 32bit UEFI PC
[Linux] WSL2 Build an environment for laravel7 with Ubuntu 20.04
How to allow nologin users to log in on Linux
I want to use OpenJDK 11 on Ubuntu Linux 18.04 LTS / 18.10
How to build a development environment for TensorFlow (1.0.0) (Mac)
[AWS EC2] How to install Maven on Amazon Linux 2
How to install git on Linux such as EC2
[Tips] How to use iPhone as webcam on Linux
[AWS] How to expand disk space on Amazon linux
How to register on pypi
Build python3 environment with ubuntu 16.04
Build Python environment on Windows
Build python environment on windows
Linux environment construction (on WSL environment)
How to build a beautiful Python environment on a new Mac and install Jupter Notebook
How to use Fujifilm X-T3 as a webcam on Ubuntu 20.04
Install LAMP on Amazon Linux 2 and build a WordPress environment.
How to set up Ubuntu for Windows Subsystem for Linux 2 (WSL2)
Build an Ubuntu python development environment on Google Cloud Platform