

Setenv PATH $:/usr/lib/jvm/jdk-19/bin:/usr/lib/jvm/jdk-20/db/binįinally, change the permissions via command, and it should take place next time you log in. Option 2.) To make it permanent, create and edit config file via command: sudo gedit /etc/profile.d/jdk.shĮxport PATH=$PATH:/usr/lib/jvm/jdk-20/bin:/usr/lib/jvm/jdk-20/db/binĪnd create anther one for C shell: sudo gedit /etc/profile.d/jdk.csh Option 1.) Set JAVA_HOME for current command console, that will work until you close it: export JAVA_HOME=/usr/lib/jvm/jdk-20 setenv JAVA_HOME=/usr/lib/jvm/jdk-20 When done, verify by running command in terminal: java -version javac -version sudo update-alternatives -config java sudo update-alternatives -config javac sudo update-alternatives -config jar Similarly, add links for other executable files (e.g., jarsigner, jlink, javadoc) as you need.ī.) Next, run the commands below one by one, and type number to select Java JDK 20 as default.
#INSTALL JAVA UBUNTU INSTALL#
You can do so by running the following commands: apt-get update & apt-get upgrade Step 2: Install the default JDK Run the following command: apt-get install default-jdk And that’s it. To set it as default, do the following 2 steps one by one.Ī.) Create symbolic links for the executable files: sudo update-alternatives -install /usr/bin/java java /usr/lib/jvm/jdk-20/bin/java 1 sudo update-alternatives -install /usr/bin/javac javac /usr/lib/jvm/jdk-20/bin/javac 1 sudo update-alternatives -install /usr/bin/jar jar /usr/lib/jvm/jdk-20/bin/jar 1 Step 1: Update Ubuntu The first thing you should always do is update your system. It installs the language files into ‘ /usr/lib/jvm/jdk-20/‘ directory. Then, extract the tarball to that directory via: sudo tar -zxf ~/Downloads/jdk-20_linux-aarch64_ -C /usr/lib/jvm/ 3. deb in file manager to install it via Ubuntu Software App.įor ARM device, run command to create ‘/usr/lib/jvm’ directory in case it does not exist: sudo mkdir -p /usr/lib/jvm

Once you downloaded the package, open terminal (Ctrl+Alt+T) and run the command below to install the deb package: sudo apt install ~/Downloads/jdk-20_linux-圆4_bin.deb deb package for modern PC and laptops, or tarball for ARM cpu architecture.
