Termux-Java icon indicating copy to clipboard operation
Termux-Java copied to clipboard

Android 11 termux java fixer

Open XopmoH97 opened this issue 4 years ago • 5 comments

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 :-)

XopmoH97 avatar Jul 11 '21 13:07 XopmoH97

this is not fixed :< this is a replacement

NTT1906 avatar Jul 23 '21 06:07 NTT1906

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

Legit-Das avatar Oct 28 '21 04:10 Legit-Das

Thxs, it worked !

Chaikew avatar Nov 14 '21 15:11 Chaikew

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

Chaikew avatar Nov 14 '21 15:11 Chaikew

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

Legit-Das avatar Nov 25 '21 21:11 Legit-Das