Install Java 16 on Android(Termux)

 Steps to install Java 16 on Android (Ubuntu) by Aniket Mohan


Video Tutorial




https://youtu.be/PG-Bemaz6y8

The txt flie has been upgraded to this blog.

1. Run the following command to install ubuntu on termux(You can also run the ubuntu commands on termux but when we will install java 16 from .deb you need to do much hardwork finding and downloading the dependencies of java 16.)


If You have Android version 6 or less run these commands


To install Ubuntu

Watch this video


If you have Android Version 7 or higher(aka the best way to install ubuntu on termux)


To install ubuntu


pkg install proot-distro
proot-distro install ubuntu


proot-distro login ubuntu

The above command logs you in ubuntu.

Type logout or exit to exit.


Then run this command in ubuntu otherwise you will face errors.


mkdir -p /usr/share/man/man7


[Note: If any commands asks for superuser permission then run the command by prefixing with the keyword sudo (for example sudo apt update)]

First check for java-16 package by typing 

apt update -y

apt upgrade -y

apt search openjdk-16

If their is a package then install it by typing

apt install openjdk-16-jre-headless openjdk-16-jdk-headless


If not then run these commands

2. Install JDK-16,JRE-16 (dependency for JDK),libjpeg62-turbo (dependency for JRE) by Running the following commands in UBUNTU we have just installed

apt update && apt upgrade -y

apt install wget

If the below commands show error that wget command not found

wget http://ftp.br.debian.org/debian/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_2.0.6-4_arm64.deb

This line downloads libjpeg62-turbo .deb file


wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-16/openjdk-16-jre-headless_16.0.1+9-1~20.04_amd64.deb

This line downloads JRE-16 .deb file


wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-16/openjdk-16-jdk-headless_16.0.1+9-1~20.04_amd64.deb

This line downloads JDK-16 .deb file


Time to Install these Run the following commands

apt upgrade && apt update

Most Important command


apt install -y ./libjpeg62-turbo_2.0.6-4_arm64.deb


apt install -y ./openjdk-16-jre-headless_16.0.2+7-2_arm64.deb


apt install -y ./openjdk-16-jdk-headless_16.0.2+7-2_arm64.deb


After that you can delete the .deb files by running

rm *.deb


Note : If you got any error like the dependency is missing just search on google "[Dependency name] .deb and go to the first pkgs.org link and click on any of the options of the dependency .deb and scroll down where you get the source link and the execute wget [The link you copied] && apt install -y [file downloaded]. With this procedure you can also install this on Termux without ubuntu


3. Done... Thats it. Try running java -version and javac -version to verify. To run java program Run javac [filename.java] and ls(to check the .class file) and java [filename] without .class . Please subscribe to my YouTube Channel.  Bye... Enjoy Java-16...


You also need a text editor. You can use vim or nano. See the video above from 21:00 to see the use of vim.


Subscribe

Aniket's Youtube Channel



Comments

Post a Comment

Popular Posts