5

I need to install some packages and Linux programs on my android devices. for example I want to use something similar YUM or get-apt command (I know these are Linux Commands) through windows powershell connected to my android device. but it does not recognize these commands. even ADB does not work, e.g. adb update -y is unknown command. How can i do this, is it possible. if the android kernel is linux so I guess there must be a way. I checked this but didnt help me:

Is it possible to install the JDK on an android device?

Thanks

EDITED: I used the link below , thanks to my friend for good answer. this is the command i used :

pkg install wget && wget https://raw.githubusercontent.com/MasterDevX/java/master/installjava && bash installjava

BUT when i run java command it says "Killed". No Idea!

Azzurro94
  • 479
  • 1
  • 7
  • 19

7 Answers7

3

Try Termux, a linux terminal emulator for android.A minimal base system is installed automatically - additional packages are available using the APT package manager. You can use following commands to install java8.

  1. pkg install git
  2. git clone https://github.com/MasterDevX/Termux-Java.git
  3. cd Termux-Java
  4. chmod +x installjava
  5. bash installjava

When installed, run java -version to check, if it's correcty installed. After that you can run java using Java command.

Buddhika Bandara
  • 351
  • 1
  • 11
2

$ apt update && apt upgrade $ apt install openjdk-17

RikyXD
  • 21
  • 1
1

First of all install termux. Then run following commands :

$ pkg update -y && pkg upgrade -y

$ termux-setup-storage

And give the storage permission. After that download these 2 files.

JDK-9 : https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb

JRE-9 : https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jre-headless_9.2017.8.20-1_arm.deb

Remember the filenames, and the folder where you downloaded the files.

Go back to termux and run :

$ cd /sdcard/<folder name>

Replace foldername with your download folder.

$ mv file1 file2 $HOME

Replace file1 and file2 with actual filenames.

Alternative :

If you don’t want to download and move files manually you can use this commands (not recommended) :

$ pkg install wget -y

$ wget https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb

$ wget https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jre-headless_9.2017.8.20-1_arm.deb

It will download files within your termux home directory.

Finally run,

$ apt-get install -y ./openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb

$ apt-get install -y ./openjdk-9-jre-headless_9.2017.8.20-1_arm.deb

And You're done. Try typing java or javac. If you don’t see an Error you're good to go.

See Source

Mr. lindroid
  • 162
  • 1
  • 12
1

First, you need to install termux from their f droid link. Their playstore version is not updated. You can find the fdroid link from their github repository.

run the following command:

apt update
apt search openjdk

If you find a version of openjdk available, for example : presently openjdk-17 is available

install it using command:

apt install package-name

example:

apt install openjdk-17

follow the prompts and java will be installed in your termux.

Elikill58
  • 4,050
  • 24
  • 23
  • 45
ayush shaw
  • 11
  • 1
0

Download java is possible Check this github link

Termux java https://github.com/EagleComrade/Termux-java.git

It provides direct installtion of java from termux-source Installtion from unwanted sources are not really trusted So this tool is realy great Do the following for install java without errors.

      pkg install git

     git clone https://github.com/EagleComrade/Termux-java.git

    cd Termux-java
 
    chmod +x install.sh

    ./install.sh

Java is installed .......

Programer
  • 1
  • 1
0

Install termux and run these commands

pkg update

pkg install openjdk-17

java --version
Arun KB
  • 5
  • 3
-3

Install ubuntu on termux from anlinux... Then use

$ apt install default-jdk

Job done!

Obsidian
  • 3,719
  • 8
  • 17
  • 30