how to install java in termux without root

how to install java in termux without root - java programming language 

Welcome, In this article i am going to show you how to install java jdk/jre in android via Termux app without rooting android device. Java is a general purpose computer programming language with the help of java programming we can develop android applications, Desktop graphical user interface application, web applications, enterprise applications, embedded systems, web servers, scientific application etc.

we can install and run java programming language in termux. so follow the below procedure

Install java in Termux 

open Termux android app and update using apt update command
we need to install drimngr and gnupg by typing this command apt install dirmngr gnupg-curl -y

Now you must add the repository in such directory so use the below command 
mkdir -p $PREFIX/etc/apt/sources.list.d && echo "deb https://termux.xeffyr.ml/ extra main x11" > $PREFIX/etc/apt/sources.list.d/list.list


Its time to update so update termux with apt update command

Now you guys can easily install java jdk in Termux using below command
apt install openjdk-9-jdk-headless -y

Thank you !

3 Comments

  1. thanks mate for this post, but I have the following error:
    $ apt update
    Hit:1 https://termux.net stable InRelease
    Err:2 https://termux.xeffyr.ml extra InRelease
    Connection timed out after 120000 milliseconds
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    20 packages can be upgraded. Run 'apt list --upgradable' to see them.
    W: Failed to fetch https://termux.xeffyr.ml/dists/extra/InRelease Connection timed out after 120000 milliseconds
    W: Some index files failed to download. They have been ignored, or old ones used instead.

    ReplyDelete
  2. I have error to add the repository.
    How to add repository for installing Java in termux

    ReplyDelete
Previous Post Next Post