Setup Java Development Environment in Remote Ubuntu Desktop on Oracle Cloud
In this blog post we will setup Java development environment in Remote Desktop created based on Ubuntu server on Oracle Cloud.
In my previous blog posts ( part-i, part-ii), I have shown you how to setup the free Ubuntu based remote desktop on Oracle cloud using Ampere A1 processor. Now we will install JDK, Java IDEs , VS Code , Node JS and Docker software which enables us to develop Java and JavaScript based applications.
Since Ampere A1 processor is ARM architecture based we need to install ARM architecture supported software only.
For installing Java and Maven software we will use software called SDKMAN.
With SDKMAN, we can easily install JDK’s from different vendors and switch between versions and vendors. SDKMAN will take care of installing Java based on your processor architecture.
Using SDKMAN you can install lot of other libraries. Please check the complete list here
Installing SDKMAN
Open your terminal and enter following command to download.
curl -s "https://get.sdkman.io" | bash
Code language: Java (java)
...
Set version to 5.16.0 ...
Set native version to 0.0.15 ...
Attempt update of interactive bash profile on regular UNIX...
Attempt update of zsh profile...
All done!
You are subscribed to the STABLE channel.
Please open a new terminal, or run the following in the existing one:
source "/home/suresh/.sdkman/bin/sdkman-init.sh"
Then issue the following command:
sdk help
Enjoy!!!
Code language: Java (java)
Follow the on-screen instructions to complete the installation.
source "/home/suresh/.sdkman/bin/sdkman-init.sh"
Code language: Java (java)
You can verify the installation of sdkman with following command.
Code language: Java (java)sdk version
If the installation was successful, the version should be displayed. Something like:
sdkman 5.16.0
Code language: Java (java)
Installing Java
Next let’s install Java
Following command lists all the JDK’s that can be installed
Code language: Java (java)sdk list java
The above command show lists like below.
================================================================================
Available Java Versions for Linux ARM 64bit
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
AdoptOpenJDK | | 8.0.275+1.hs | adpt | | 8.0.275+1.hs-adpt
| | 8.0.252.hs | adpt | | 8.0.252.hs-adpt
Corretto | | 19 | amzn | | 19-amzn
| | 19.0.1 | amzn | | 19.0.1-amzn
| | 17.0.5 | amzn | | 17.0.5-amzn
| | 17.0.4 | amzn | | 17.0.4-amzn
| | 11.0.17 | amzn | | 11.0.17-amzn
| | 11.0.16 | amzn | | 11.0.16-amzn
| | 8.0.352 | amzn | | 8.0.352-amzn
| | 8.0.342 | amzn | | 8.0.342-amzn
Dragonwell | | 17.0.5 | albba | | 17.0.5-albba
| | 17.0.4 | albba | | 17.0.4-albba
| | 11.0.17 | albba | | 11.0.17-albba
| | 11.0.16 | albba | | 11.0.16-albba
| | 8.0.352 | albba | | 8.0.352-albba
| | 8.0.345 | albba | | 8.0.345-albba
GraalVM | | 22.3.r19 | grl | | 22.3.r19-grl
| | 22.3.r17 | grl | | 22.3.r17-grl
| | 22.3.r11 | grl | | 22.3.r11-grl
| | 22.2.r17 | grl | | 22.2.r17-grl
| | 22.2.r11 | grl | | 22.2.r11-grl
| | 22.1.0.r17 | grl | | 22.1.0.r17-grl
| | 22.1.0.r11 | grl | | 22.1.0.r11-grl
| | 22.0.0.2.r17 | grl | | 22.0.0.2.r17-grl
| | 22.0.0.2.r11 | grl | | 22.0.0.2.r11-grl
| | 21.3.3.r17 | grl | | 21.3.3.r17-grl
| | 21.3.3.r11 | grl | | 21.3.3.r11-grl
| | 21.3.3.1.r17 | grl | | 21.3.3.1.r17-grl
| | 21.3.3.1.r11 | grl | | 21.3.3.1.r11-grl
| | 21.3.2.r17 | grl | | 21.3.2.r17-grl
| | 21.3.2.r11 | grl | | 21.3.2.r11-grl
Java.net | | 20.ea.26 | open | | 20.ea.26-open
| | 20.ea.25 | open | | 20.ea.25-open
| | 20.ea.24 | open | | 20.ea.24-open
| | 20.ea.23 | open | | 20.ea.23-open
| | 20.ea.22 | open | | 20.ea.22-open
| | 19 | open | | 19-open
| | 19.0.1 | open | | 19.0.1-open
| | 11.0.12 | open | | 11.0.12-open
| | 8.0.302 | open | | 8.0.302-open
Liberica | | 19.fx | librca | | 19.fx-librca
| | 19.0.1.fx | librca | | 19.0.1.fx-librca
| | 19.0.1 | librca | | 19.0.1-librca
.....
Code language: Java (java)
Using identifier shown in above table, we can install the required JDK’s
The generic command to install java is
Code language: Java (java)sdk install java <identifier>
Let’s install the GraalVM Java 17 and 11 versions
sdk install java 22.3.r17-gr
Code language: Java (java)
Downloading: java 22.3.r17-grl
In progress...
#####################################################################
Code language: Java (java)
You can verify the installed Java versions by running the below command .
The status column indicates the installed status
Code language: Java (java)sdk list java
================================================================================
Available Java Versions for Linux ARM 64bit
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
AdoptOpenJDK | | 8.0.275+1.hs | adpt | | 8.0.275+1.hs-adpt
| | 8.0.252.hs | adpt | | 8.0.252.hs-adpt
Corretto | | 19 | amzn | | 19-amzn
| | 19.0.1 | amzn | | 19.0.1-amzn
| | 17.0.5 | amzn | | 17.0.5-amzn
| | 17.0.4 | amzn | | 17.0.4-amzn
| | 11.0.17 | amzn | | 11.0.17-amzn
| | 11.0.16 | amzn | | 11.0.16-amzn
| | 8.0.352 | amzn | | 8.0.352-amzn
| | 8.0.342 | amzn | | 8.0.342-amzn
Dragonwell | | 17.0.5 | albba | | 17.0.5-albba
| | 17.0.4 | albba | | 17.0.4-albba
| | 11.0.17 | albba | | 11.0.17-albba
| | 11.0.16 | albba | | 11.0.16-albba
| | 8.0.352 | albba | | 8.0.352-albba
| | 8.0.345 | albba | | 8.0.345-albba
GraalVM | | 22.3.r19 | grl | | 22.3.r19-grl
| >>> | 22.3.r17 | grl | installed | 22.3.r17-grl
| | 22.3.r11 | grl | installed | 22.3.r11-grl
| | 22.2.r17 | grl | | 22.2.r17-grl
| | 22.2.r11 | grl | | 22.2.r11-grl
| | 22.1.0.r17 | grl | | 22.1.0.r17-grl
| | 22.1.0.r11 | grl | | 22.1.0.r11-grl
| | 22.0.0.2.r17 | grl | | 22.0.0.2.r17-grl
| | 22.0.0.2.r11 | grl | | 22.0.0.2.r11-grl
| | 21.3.3.r17 | grl | | 21.3.3.r17-grl
| | 21.3.3.r11 | grl | | 21.3.3.r11-grl
| | 21.3.3.1.r17 | grl | | 21.3.3.1.r17-grl
| | 21.3.3.1.r11 | grl | | 21.3.3.1.r11-grl
| | 21.3.2.r17 | grl | | 21.3.2.r17-grl
| | 21.3.2.r11 | grl | | 21.3.2.r11-grl
Java.net | | 20.ea.26 | open | | 20.ea.26-open
| | 20.ea.25 | open | | 20.ea.25-open
| | 20.ea.24 | open | | 20.ea.24-open
| | 20.ea.23 | open | | 20.ea.23-open
| | 20.ea.22 | open | | 20.ea.22-open
| | 19 | open | | 19-open
| | 19.0.1 | open | | 19.0.1-open
| | 11.0.12 | open | | 11.0.12-open
| | 8.0.302 | open | | 8.0.302-open
Liberica | | 19.fx | librca | | 19.fx-librca
| | 19.0.1.fx | librca | | 19.0.1.fx-librca
| | 19.0.1 | librca | | 19.0.1-librca
| | 19 | librca | | 19-librca
| | 17.0.5.fx | librca | | 17.0.5.fx-librca
| | 17.0.5 | librca | | 17.0.5-librca
Code language: Java (java)
Knowing current version of Java
Code language: Java (java)sdk current java
Using java version 22.3.r17-grl
Code language: Java (java)
Switching default version of Java
sdk default java 22.3.r11-grl
Code language: Java (java)
Default java version set to 22.3.r11-grl
Code language: Java (java)
Checking the current version of Java after changing default java version
Code language: Java (java)sdk current java
Default java version set to 22.3.r11-grl
Code language: Java (java)
Installing the Maven
You can list available Maven version with following command
Code language: Java (java)sdk list maven
================================================================================
Available Maven Versions
================================================================================
3.8.6 3.3.3
3.8.5 3.3.1
3.8.4 3.2.5
3.8.3 3.2.3
3.8.2 3.2.2
3.8.1 3.2.1
3.6.3 3.1.1
3.6.2 3.1.0
3.6.1 3.0.5
3.6.0 3.0.4
3.5.4
3.5.3
3.5.2
3.5.0
3.3.9
================================================================================
+ - local version
* - installed
> - currently in use
Code language: Java (java)
Install required Maven version
sdk install maven 3.8.6
Code language: Java (java)
Check the Maven installation
Code language: Java (java)mvn --version
If you see the error message like below
Command 'mvn' not found, but can be installed with:
sudo apt install maven
Code language: Java (java)
Run the command to make installed maven, default version
sdk default maven 3.8.6
Code language: Java (java)
Installing IntelliJ Idea
Next we will install IntelliJ Idea Community Edition IDE to develop Java applications
Go to IntelliJ Idea download page and download aarch64 tar file

Extract the tar file
sudo tar -xvf ideaIC-2022.3-aarch64.tar -C /opt/
Code language: Java (java)
rename the folder
sudo mv /opt/idea-IC-223.7571.182/ /opt/idea
Code language: Java (java)
IntelliJ Idea Linux arm version does not support creating shortcut to program on Desktop
If you want to start the IDE
Open your terminal and run the following command.
Code language: Java (java)/opt/idea/bin/idea.sh
To create desktop shortcut you need to create launcher file manually.
Right click on the desktop and click on “Create Launcher” menu option.

In “Create Launcher” window enter following details and click “Ok” button to create desktop shortcut.
- Name : IntelliJ Idea
- Description : IntelliJ Idea
- Command : /opt/idea/bin/idea.sh
- Icon : /opt/idea/bin/idea.png
- Terminal : No
- Type : Application

You can also create launcher by creating “IntelliJIdea.desktop” file and enter following text into it.
[Desktop Entry]
Name=IntelliJ Idea
GenericName=IntelliJ Idea
Comment=
Exec=/opt/idea/bin/idea.sh
Type=Application
Icon=/opt/idea/bin/idea.png
Terminal=false
Code language: Java (java)
Installing Eclipse
If you prefer Eclipse to IntelliJ Idea
Go to https://www.eclipse.org/downloads/ page and download the AArch64 version of the tar of tar file.
Unpack the installer
Code language: Java (java)sudo tar -xvf eclipse-inst-jre-linux-aarch64.tar.gz
Go to the extracted “eclipse-installed” folder and click on the “eclipse-inst” file to open the installer.
From the installer choose one of below options
Eclipse IDE for Java Developer
or
Eclipse IDE for Enterprise Java Developer

Click on the “Install” button

Installing VS Code
Go to https://code.visualstudio.com/Download# and download the arm64 deb package.
Install VS Code with following command.
sudo dpkg -i code_1.74.0-1670258379_arm64.deb
Code language: Java (java)
Installing Docker
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
Code language: Java (java)sudo apt update
Code language: Java (java)sudo apt install \ ca-certificates \ curl \ gnupg \ lsb-release
Code language: Java (java)sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Code language: Java (java)
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Code language: Java (java)
Grant read permission for the Docker public key file before updating the package
Code language: Java (java)sudo chmod a+r /etc/apt/keyrings/docker.gpg sudo apt-get update
Install Docker Engine
To install the latest version, run following command
Code language: Java (java)sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
The Docker daemon always runs as the root
user . other users can access only access it using “sudo”
If you don’t want to preface the docker
command with sudo
, create a Unix group called docker
and add users to it. When the Docker daemon starts, it creates a Unix socket accessible by members of the docker
group.
Create docker group
Code language: Java (java)sudo groupadd docker
Add your user to the docker
group.
Code language: Java (java)sudo usermod -aG docker $USER
You can run the following command to activate the changes to groups
Code language: Java (java)newgrp docker
You can also Log out and log back in so that your group membership is re-evaluated.
Verify that you can run docker
commands without sudo
.
Code language: Java (java)docker run hello-world
Installing Docker compose
sudo curl -L "https://github.com/docker/compose/releases/download/v2.14.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Code language: Java (java)
Apply executable permissions to docker-compose binary
Code language: Java (java)sudo chmod +x /usr/local/bin/docker-compose
Test with by running
Code language: Java (java)docker-compose --help
Starting the docker service on system startup
Code language: Java (java)sudo systemctl enable docker.service sudo systemctl enable containerd.service
Installing NVM
NVM is used to install and switch between different versions of Node JS
From Terminal run nvm installer script
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
Code language: Java (java)
The nvm installer script creates an environment entry to the login script of the current user. You can either log out and log in again to load the environment or execute the below command to do the same.
Code language: Java (java)source ~/.bashrc
check the installation with following command
Code language: Java (java)nvm -v
Installing Node using NVM
Open your terminal and use following commands to install the Node JS.
You can list all available Node JS version with nvm
Code language: Java (java)nvm list-remote
install the latest lts version
Code language: Java (java)nvm install --lts
install specific version
Code language: Java (java)nvm install <version-number>
Switching between Node versions
To use the latest version of LTS
Code language: Java (java)nvm use --lts
To use specific version of Node
Code language: Java (java)nvm use <version-number>
Now the remote desktop is ready for the Java and JavaScript related application development.
You might also interested in