MasterDevX / Termux-Java

Install Java (Open-JDK-8) in Termux without root!
381 stars 82 forks source link

Android 11 termux java fixer #59

Open XopmoH97 opened 3 years ago

XopmoH97 commented 3 years ago

Hi! After install java not working, error: "Bad system call" I write this script and fixed this issue:

#!/data/data/com.termux/files/usr/bin/php
<?php
$jdk = '/data/data/com.termux/files/usr/share/jdk8/bin';
$bin = '/data/data/com.termux/files/usr/bin';
$files = opendir($jdk);
while($file = readdir($files)) {
    if(is_file("$jdk/$file") && file_exists("$bin/$file")) {
        $script = file_get_contents("$bin/$file");
        $script = str_replace('exec', 'proot -0', $script);
        file_put_contents("$bin/$file", $script);
        echo "Fixed $file :-)\n";
    }
}

This script writed on php, install php( pkg install php ) and proot ( pkg install proot ) and run this script :-)

NTT1906 commented 3 years ago

this is not fixed :< this is a replacement

Legit-Das commented 2 years ago

Hi! After install java not working, error: "Bad system call" I write this script and fixed this issue:

#!/data/data/com.termux/files/usr/bin/php
<?php
$jdk = '/data/data/com.termux/files/usr/share/jdk8/bin';
$bin = '/data/data/com.termux/files/usr/bin';
$files = opendir($jdk);
while($file = readdir($files)) {
  if(is_file("$jdk/$file") && file_exists("$bin/$file")) {
      $script = file_get_contents("$bin/$file");
      $script = str_replace('exec', 'proot -0', $script);
      file_put_contents("$bin/$file", $script);
      echo "Fixed $file :-)\n";
  }
}

This script writed on php, install php( pkg install php ) and proot ( pkg install proot ) and run this script :-)

How do I run the script? Saved this as java_install.sh and ran, got this: Screenshot_20211028-093607_Termux

Chaikew commented 2 years ago

Thxs, it worked !

Chaikew commented 2 years ago

Hi! After install java not working, error: "Bad system call" I write this script and fixed this issue:

#!/data/data/com.termux/files/usr/bin/php
<?php
$jdk = '/data/data/com.termux/files/usr/share/jdk8/bin';
$bin = '/data/data/com.termux/files/usr/bin';
$files = opendir($jdk);
while($file = readdir($files)) {
    if(is_file("$jdk/$file") && file_exists("$bin/$file")) {
        $script = file_get_contents("$bin/$file");
        $script = str_replace('exec', 'proot -0', $script);
        file_put_contents("$bin/$file", $script);
        echo "Fixed $file :-)\n";
    }
}

This script writed on php, install php( pkg install php ) and proot ( pkg install proot ) and run this script :-)

How do I run the script? Saved this as java_install.sh and ran, got this: Screenshot_20211028-093607_Termux

You should run it like that : php ur_file_name.whatever

Legit-Das commented 2 years ago

Hi! After install java not working, error: "Bad system call" I write this script and fixed this issue:

#!/data/data/com.termux/files/usr/bin/php
<?php
$jdk = '/data/data/com.termux/files/usr/share/jdk8/bin';
$bin = '/data/data/com.termux/files/usr/bin';
$files = opendir($jdk);
while($file = readdir($files)) {
  if(is_file("$jdk/$file") && file_exists("$bin/$file")) {
      $script = file_get_contents("$bin/$file");
      $script = str_replace('exec', 'proot -0', $script);
      file_put_contents("$bin/$file", $script);
      echo "Fixed $file :-)\n";
  }
}

This script writed on php, install php( pkg install php ) and proot ( pkg install proot ) and run this script :-)

How do I run the script? Saved this as java_install.sh and ran, got this: Screenshot_20211028-093607_Termux

You should run it like that : php ur_file_name.whatever

Screenshot_20211126-030537_Termux it shows me this