From a9cd60199fa2187ec95bef8d6e2d10b242568db1 Mon Sep 17 00:00:00 2001 From: MasterDevX <32103950+MasterDevX@users.noreply.github.com> Date: Fri, 28 Dec 2018 13:15:55 +0200 Subject: [PATCH 01/21] Script rewrite --- installjava | 124 ++++++++++++++++------------------------------------ 1 file changed, 37 insertions(+), 87 deletions(-) diff --git a/installjava b/installjava index 6b6ab10..45224c1 100644 --- a/installjava +++ b/installjava @@ -1,92 +1,42 @@ #!/data/data/com.termux/files/usr/bin/bash clear -sleep 0 shopt -s expand_aliases alias ee='echo -e' -ee " \033[33m----------------------------\033[0m" -ee" \033[36mLokesh:Hax4Us:€|eViL" -ee" \033[33m----------------------------\033[0m" -echo -ee" \033[36mJava Installation Script v1.0" -ee " \033[33m ----------------------------------" -echo -ee " \033[31mDon't take credits :D (Shared libraries are compiled by me)" -ee "\033[33m ------------------------------------" - -arch=`dpkg --print-architecture` - -echo "Do you want to continue (y|Y/n|N)" - read yesorno - if [ $yesorno = 'y' -o $yesorno = 'Y' ] ; then - echo "Package size is around 70mb before extraction" -echo - else - ee "\033[35mbye bye ... :D\033[0m" - exit -fi - if [ $arch = "aarch64" -o $arch = "arm64" ] ; then - - ee "\033[32m[*] Now wait until jdk-8 is installing ...πŸ•›πŸ•§\033[0m" - echo - -wget https://github.com/Hax4us/java/releases/download/v8/jdk8_aarch64.tar.gz - -echo -ee "\033[32m[*] Moving jdk into system ...\033[0m" -mv jdk8_aarch64.tar.gz $PREFIX/share - -ee "\033[32m[*] Extracting ...\033[0m" -cd $PREFIX/share -tar -xhf jdk8_aarch64.tar.gz - -ee "\033[32m[*] Moving wrapper scripts for java 8\033[0m" -mv bin/* $PREFIX/bin - -ee "\033[34mHappy java :D\033[0m" - - elif [ $arch = "armhf" -o $arch = "armv7l" ]; then - echo "armhf" - ee "\033[32m[*] Now wait until jdk-8 is installing ...πŸ•›πŸ•§\033[0m" - echo - -wget https://github.com/Hax4us/java/releases/download/v8-151/jdk8_arm.tar.gz - -echo -ee "\033[32m[*] Moving jdk into system ...\033[0m" -mv jdk8_arm.tar.gz $PREFIX/share -echo -ee "\033[32m[*] Extracting ...\033[0m" -cd $PREFIX/share -tar -xhf jdk8_arm.tar.gz -echo -ee "\033[32m[*] Moving wrapper scripts for java 8\033[0m" -mv bin/* $PREFIX/bin -rm -rf $PREFIX/share/bin -echo -ee "\033[34mHappy java :D\033[0m" - - - elif [ $arch = "arm" ]; then - ee "\033[32m[*] Now wait until jdk-8 is installing ...πŸ•›πŸ•§\033[0m" - echo - -wget https://github.com/Hax4us/java/releases/download/v8-151/jdk8_arm.tar.gz - -echo -ee "\033[32m[*] Moving jdk into system ...\033[0m" -mv jdk8_arm.tar.gz $PREFIX/share -echo -ee "\033[32m[*] Extracting ...\033[0m" -cd $PREFIX/share -tar -xhf jdk8_arm.tar.gz -echo -ee "\033[32m[*] Moving wrapper scripts for java 8\033[0m" -mv bin/* $PREFIX/bin -rm -rf $PREFIX/share/bin -echo -ee "\033[34mHappy java :D\033[0m" - - - else - ee "\033[31munknown architecture :( plz contact @hax4us for more info\033[0m" +ee "\e[34mThis script will install Java in Termux." +ee "\e[34mLibraries compiled by \e[32mHax4us\e[34m, script written by \e[32mHax4us \e[34mand \e[32mMasterDevX\e[34m." +echo +if [ -e $PREFIX/bin/java ] +then + ee "\e[32mJava is already installed!" + echo + exit +else + case `dpkg --print-architecture` in + aarch64) + archname="aarch64" ;; + arm64) + archname="aarch64" ;; + armhf) + archname="arm" ;; + armv7l) + archname="arm" ;; + arm) + archname="arm" ;; + *) + ee "\e[31mERROR: Unknown architecture."; exit ;; + esac + ee "\e[34m[*] Downloading JDK-8 (~70Mb) for ${archname}..." + wget https://github.com/Hax4us/java/releases/download/v8/jdk8_${archname}.tar.gz + echo + ee "\e[34m[*] Moving JDK to system..." + mv jdk8_${archname}.tar.gz $PREFIX/share + echo + ee "\e[34m[*] Extracting JDK..." + cd $PREFIX/share + tar -xhf jdk8_${archname}.tar.gz + echo + ee "\e[34m[*] Moving Java wrapper scripts to bin..." + mv bin/* $PREFIX/bin + echo + ee "\e[32mJava was successfully installed!" fi From cbe4cd5d0aa0e8302628254177d4649005422d21 Mon Sep 17 00:00:00 2001 From: MasterDevX <32103950+MasterDevX@users.noreply.github.com> Date: Fri, 28 Dec 2018 13:42:04 +0200 Subject: [PATCH 02/21] Improvisation --- installjava | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installjava b/installjava index 45224c1..19634b9 100644 --- a/installjava +++ b/installjava @@ -1,5 +1,5 @@ #!/data/data/com.termux/files/usr/bin/bash -clear +echo shopt -s expand_aliases alias ee='echo -e' ee "\e[34mThis script will install Java in Termux." @@ -26,7 +26,7 @@ else ee "\e[31mERROR: Unknown architecture."; exit ;; esac ee "\e[34m[*] Downloading JDK-8 (~70Mb) for ${archname}..." - wget https://github.com/Hax4us/java/releases/download/v8/jdk8_${archname}.tar.gz + wget https://github.com/Hax4us/java/releases/download/v8/jdk8_${archname}.tar.gz -q echo ee "\e[34m[*] Moving JDK to system..." mv jdk8_${archname}.tar.gz $PREFIX/share @@ -38,5 +38,5 @@ else ee "\e[34m[*] Moving Java wrapper scripts to bin..." mv bin/* $PREFIX/bin echo - ee "\e[32mJava was successfully installed!" + ee "\e[32mJava was successfully installed!\e[39m" fi From 6d0eaf4b9796c1563fea91316689dfcfd4bef4fc Mon Sep 17 00:00:00 2001 From: MasterDevX <32103950+MasterDevX@users.noreply.github.com> Date: Fri, 28 Dec 2018 14:00:19 +0200 Subject: [PATCH 03/21] Update README.md --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4d72e0c..b6fa0ce 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ -# Java for termux -# Steps -1.mv java/openjdk/java /data/data/com.termux/files/usr/bin +# Termux Java +### Information +This script will install Java in Termux.
+Libraries compiled by Hax4us, script written by Hax4us and MasterDevX. -2.Now you can execute java +### How to use +To install Java, open Termux and execute the following command: +```pkg install wget && wget https://raw.githubusercontent.com/MasterDevX/java/master/installjava && bash installjava``` -# Hello I am Lokesh (devil - admin of hax4us channel & website ) - -# This is a try to use java easily in termux plz dont put my hardwork into dustbean by copying my work :D thnx +After that you can run Java using ```java``` command. From c81bd36b437c3d1f20d75039aa257748ee335bc9 Mon Sep 17 00:00:00 2001 From: MasterDevX <32103950+MasterDevX@users.noreply.github.com> Date: Fri, 28 Dec 2018 14:01:52 +0200 Subject: [PATCH 04/21] Added missing linebreak --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6fa0ce..7e25fab 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This script will install Java in Termux.
Libraries compiled by Hax4us, script written by Hax4us and MasterDevX. ### How to use -To install Java, open Termux and execute the following command: +To install Java, open Termux and execute the following command:
```pkg install wget && wget https://raw.githubusercontent.com/MasterDevX/java/master/installjava && bash installjava``` After that you can run Java using ```java``` command. From d7bb1880bf549b596aafaf44d4023646ecf57029 Mon Sep 17 00:00:00 2001 From: MasterDevX <32103950+MasterDevX@users.noreply.github.com> Date: Fri, 28 Dec 2018 14:14:16 +0200 Subject: [PATCH 05/21] rm -rf temporary files after installation --- installjava | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/installjava b/installjava index 19634b9..693a059 100644 --- a/installjava +++ b/installjava @@ -38,5 +38,11 @@ else ee "\e[34m[*] Moving Java wrapper scripts to bin..." mv bin/* $PREFIX/bin echo + ee "\e[34m[*] Cleaning up temporary files..." + rm -rf $HOME/installjava + rm -rf $PREFIX/share/jdk8_${archname}.tar.gz + rm -rf $PREFIX/share/bin + echo ee "\e[32mJava was successfully installed!\e[39m" + echo fi From 323c0c658d54dd5068236118c8952fb88fe338bc Mon Sep 17 00:00:00 2001 From: MasterDevX <32103950+MasterDevX@users.noreply.github.com> Date: Wed, 13 Feb 2019 13:02:29 +0200 Subject: [PATCH 06/21] Improved echo --- installjava | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/installjava b/installjava index 693a059..c1457ae 100644 --- a/installjava +++ b/installjava @@ -1,9 +1,10 @@ #!/data/data/com.termux/files/usr/bin/bash -echo + shopt -s expand_aliases alias ee='echo -e' -ee "\e[34mThis script will install Java in Termux." -ee "\e[34mLibraries compiled by \e[32mHax4us\e[34m, script written by \e[32mHax4us \e[34mand \e[32mMasterDevX\e[34m." +echo +ee "\e[93mThis script will install Java in Termux." +ee "\e[93mLibraries compiled by \e[32mHax4us\e[93m, script written by \e[32mHax4us \e[93mand \e[32mMasterDevX\e[93m." echo if [ -e $PREFIX/bin/java ] then @@ -23,22 +24,18 @@ else arm) archname="arm" ;; *) - ee "\e[31mERROR: Unknown architecture."; exit ;; + ee "\e[91mERROR: Unknown architecture."; echo; exit ;; esac - ee "\e[34m[*] Downloading JDK-8 (~70Mb) for ${archname}..." + ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}..." wget https://github.com/Hax4us/java/releases/download/v8/jdk8_${archname}.tar.gz -q - echo - ee "\e[34m[*] Moving JDK to system..." + ee "\e[32m[*] \e[34mMoving JDK to system..." mv jdk8_${archname}.tar.gz $PREFIX/share - echo - ee "\e[34m[*] Extracting JDK..." + ee "\e[32m[*] \e[34mExtracting JDK..." cd $PREFIX/share tar -xhf jdk8_${archname}.tar.gz - echo - ee "\e[34m[*] Moving Java wrapper scripts to bin..." + ee "\e[32m[*] \e[34mMoving Java wrapper scripts to bin..." mv bin/* $PREFIX/bin - echo - ee "\e[34m[*] Cleaning up temporary files..." + ee "\e[32m[*] \e[34mCleaning up temporary files..." rm -rf $HOME/installjava rm -rf $PREFIX/share/jdk8_${archname}.tar.gz rm -rf $PREFIX/share/bin From 182616e6269fbffcc7c4f56b2b2f8627078e4ed8 Mon Sep 17 00:00:00 2001 From: MasterDevX <32103950+MasterDevX@users.noreply.github.com> Date: Thu, 13 Jun 2019 22:01:07 +0300 Subject: [PATCH 07/21] Fixed URL --- installjava | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/installjava b/installjava index c1457ae..ad5a879 100644 --- a/installjava +++ b/installjava @@ -14,15 +14,15 @@ then else case `dpkg --print-architecture` in aarch64) - archname="aarch64" ;; + archname="aarch64"; tag="v8" ;; arm64) - archname="aarch64" ;; + archname="aarch64"; tag="v8" ;; armhf) - archname="arm" ;; + archname="arm"; tag="v8-151" ;; armv7l) - archname="arm" ;; + archname="arm"; tag="v8-151" ;; arm) - archname="arm" ;; + archname="arm"; tag="v8-151" ;; *) ee "\e[91mERROR: Unknown architecture."; echo; exit ;; esac From d7bcc6336ebfc654cca0ad1c16b54dd6d403ab9b Mon Sep 17 00:00:00 2001 From: MasterDevX <32103950+MasterDevX@users.noreply.github.com> Date: Thu, 13 Jun 2019 22:02:03 +0300 Subject: [PATCH 08/21] Fixed tag --- installjava | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installjava b/installjava index ad5a879..b5e34c0 100644 --- a/installjava +++ b/installjava @@ -27,7 +27,7 @@ else ee "\e[91mERROR: Unknown architecture."; echo; exit ;; esac ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}..." - wget https://github.com/Hax4us/java/releases/download/v8/jdk8_${archname}.tar.gz -q + wget https://github.com/Hax4us/java/releases/download/${tag}/jdk8_${archname}.tar.gz -q ee "\e[32m[*] \e[34mMoving JDK to system..." mv jdk8_${archname}.tar.gz $PREFIX/share ee "\e[32m[*] \e[34mExtracting JDK..." From 46bfd1ba4f87bbf62c01240b81e3f78cb18bbdba Mon Sep 17 00:00:00 2001 From: Guzio Date: Wed, 8 Apr 2020 22:30:58 +0000 Subject: [PATCH 09/21] Added GitPod support Signed-off-by: Guzio --- .gitpod.yml | 3 +++ README.md | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..924a0fd --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,3 @@ +tasks: + - init: echo "I hope you realized that GitPod is the last needed thing in Termux packages development and you have no point in being here, right?" +image: gitpod/workspace-full diff --git a/README.md b/README.md index 7e25fab..572e871 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code%20(for%20some%20reason)-blue?logo=gitpod)](https://gitpod.io/#https://github.com/MasterDevX/Termux-Java) + # Termux Java ### Information This script will install Java in Termux.
From f03b982961c3bbe983926e5ef676763423dd2a78 Mon Sep 17 00:00:00 2001 From: Guzio Date: Wed, 8 Apr 2020 22:38:59 +0000 Subject: [PATCH 10/21] Cleaned up that terrible mess in script installjava Signed-off-by: Guzio --- installjava | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/installjava b/installjava index b5e34c0..8e42967 100644 --- a/installjava +++ b/installjava @@ -2,16 +2,21 @@ shopt -s expand_aliases alias ee='echo -e' + +#Greetings echo ee "\e[93mThis script will install Java in Termux." ee "\e[93mLibraries compiled by \e[32mHax4us\e[93m, script written by \e[32mHax4us \e[93mand \e[32mMasterDevX\e[93m." echo + +#Checking for existing Java installation if [ -e $PREFIX/bin/java ] then ee "\e[32mJava is already installed!" echo exit else + #Checking, whether is someone trying to cheat and simplyfy their instalLation it on Linux (i.e. x86 (not listad, as you can see) machine) case `dpkg --print-architecture` in aarch64) archname="aarch64"; tag="v8" ;; @@ -26,19 +31,26 @@ else *) ee "\e[91mERROR: Unknown architecture."; echo; exit ;; esac + + #Actual installation ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}..." wget https://github.com/Hax4us/java/releases/download/${tag}/jdk8_${archname}.tar.gz -q + ee "\e[32m[*] \e[34mMoving JDK to system..." mv jdk8_${archname}.tar.gz $PREFIX/share + ee "\e[32m[*] \e[34mExtracting JDK..." cd $PREFIX/share tar -xhf jdk8_${archname}.tar.gz + ee "\e[32m[*] \e[34mMoving Java wrapper scripts to bin..." mv bin/* $PREFIX/bin + ee "\e[32m[*] \e[34mCleaning up temporary files..." rm -rf $HOME/installjava rm -rf $PREFIX/share/jdk8_${archname}.tar.gz rm -rf $PREFIX/share/bin + echo ee "\e[32mJava was successfully installed!\e[39m" echo From fab0c89ff2d492c585a6c7fe1f49326daef046f4 Mon Sep 17 00:00:00 2001 From: Guzio Date: Wed, 8 Apr 2020 23:00:15 +0000 Subject: [PATCH 11/21] Configured %JAVA_HOME%. Signed-off-by: Guzio --- installjava | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/installjava b/installjava index 8e42967..98f3e40 100644 --- a/installjava +++ b/installjava @@ -16,7 +16,7 @@ then echo exit else - #Checking, whether is someone trying to cheat and simplyfy their instalLation it on Linux (i.e. x86 (not listad, as you can see) machine) + #Checking, whether is someone trying to cheat and simplyfy their installation it on Linux (i.e. x86 (not listad, as you can see) machine) using this script, which have no reason to work. case `dpkg --print-architecture` in aarch64) archname="aarch64"; tag="v8" ;; @@ -43,8 +43,13 @@ else cd $PREFIX/share tar -xhf jdk8_${archname}.tar.gz - ee "\e[32m[*] \e[34mMoving Java wrapper scripts to bin..." - mv bin/* $PREFIX/bin + ee "\e[32m[*] \e[34mSeting-up %JAVA_HOME%..." + export JAVA_HOME=$PREFIX/share/jdk8 + echo "export JAVA_HOME=$PREFIX/share/jdk8" >> $HOME/.profile + + ee "\e[32m[*] \e[34mCoping Java wrapper scripts to bin..." + #I'm not 100% sure, but getting rid of bin contnent MAY cause some issues with %JAVA_HOME%, thus it's no longer moved - copied instead. Sorry to everyone short on storage. + cp bin/* $PREFIX/bin ee "\e[32m[*] \e[34mCleaning up temporary files..." rm -rf $HOME/installjava @@ -54,4 +59,4 @@ else echo ee "\e[32mJava was successfully installed!\e[39m" echo -fi +fi \ No newline at end of file From c4c09f0fccd0720ad723747abda8990cc41ae455 Mon Sep 17 00:00:00 2001 From: Guzio Date: Wed, 8 Apr 2020 23:26:16 +0000 Subject: [PATCH 12/21] Added uninstalling script. Signed-off-by: Guzio --- installjava | 1 + uninstall_java.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 uninstall_java.sh diff --git a/installjava b/installjava index 98f3e40..e45a4bd 100644 --- a/installjava +++ b/installjava @@ -1,5 +1,6 @@ #!/data/data/com.termux/files/usr/bin/bash +#Setup shopt -s expand_aliases alias ee='echo -e' diff --git a/uninstall_java.sh b/uninstall_java.sh new file mode 100644 index 0000000..d5c1cc3 --- /dev/null +++ b/uninstall_java.sh @@ -0,0 +1,37 @@ +#!/data/data/com.termux/files/usr/bin/bash + +#Setup +shopt -s expand_aliases +alias ee='echo -e' + +#Greetings +echo +ee "\e[93mThis script will uninstall Java from Termux." +echo + +#Checking for existing Java installation +if [ ! -e $PREFIX/bin/java ] +then + ee "\e[32mJava is not installed!" + echo + exit +else + #Actual uninstallation + ee "\e[32m[*] \e[34mUnseting %JAVA_HOME%..." + unset JAVA_HOME=$PREFIX/share/jdk8 + echo "[WARNING!!!]: THIS SCRIPT WILL UNSET THE %JAVA_HOME% >>ONLY TEMPORARILY<>WILL<< CAUSE PROBLEMS IN SOME APPS!!!" + + ee "\e[32m[*] \e[34mRemoving Java..." + rm -drf $PREFIX/share/jdk8 + rm $PREFIX/bin/jar + rm $PREFIX/bin/jarsigner + rm $PREFIX/bin/java + rm $PREFIX/bin/javac + rm $PREFIX/bin/javadoc + rm $PREFIX/bin/javah + rm $PREFIX/bin/javap + + echo + ee "\e[32mJava was successfully uninstalled!\e[39m" + echo +fi \ No newline at end of file From f117ac283227ede6c6de4477938f8b118f34f729 Mon Sep 17 00:00:00 2001 From: Guzio Date: Wed, 8 Apr 2020 23:33:48 +0000 Subject: [PATCH 13/21] Modified openjdk/java script to operate on %HOME%, not direct path to user Home directory. I have NO CLUE what is that file for. It looks like a remaining piece of... something, since it's totally out of context, runs java from a wrong directory and it's almost entirely commented out, but whatever. I'm going to update it, anyway. Signed-off-by: Guzio --- openjdk/java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openjdk/java b/openjdk/java index e30ab0f..fb936d4 100755 --- a/openjdk/java +++ b/openjdk/java @@ -2,8 +2,8 @@ #export LD_LIBRARY_PATH=/data/data/per.pqy.apktool/apktool/lix #in some targets,LD_PRELOAD will cause a error. export LD_PRELOAD= -export LD_LIBRARY_PATH=/data/data/com.termux/files/home/java/openjdk/lib/arm:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$HOME/java/openjdk/lib/arm:$LD_LIBRARY_PATH #umask 000 #cd /data/data/per.pqy.apktool/apktool #echo $$ > pid -exec /data/data/com.termux/files/home/java/openjdk/bin/java -Xmx1024m "$@" +exec $HOME/java/openjdk/bin/java -Xmx1024m "$@" From 89da558c175edbc4f5ea7fb0138ab4e271894177 Mon Sep 17 00:00:00 2001 From: Guzio Date: Wed, 8 Apr 2020 23:45:14 +0000 Subject: [PATCH 14/21] =?UTF-8?q?Brought=20back=20those:=20=F0=9F=95=9B?= =?UTF-8?q?=F0=9F=95=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Who removed them? That tiny detail made old script way more original. Also, I added a humours ending, similar to that one from an older release (that same one, when πŸ•›πŸ•› still existed). Signed-off-by: Guzio --- installjava | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installjava b/installjava index e45a4bd..aaf51eb 100644 --- a/installjava +++ b/installjava @@ -34,7 +34,7 @@ else esac #Actual installation - ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}..." + ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}... πŸ•›This will take some time, so better make a coffee.πŸ•§" wget https://github.com/Hax4us/java/releases/download/${tag}/jdk8_${archname}.tar.gz -q ee "\e[32m[*] \e[34mMoving JDK to system..." @@ -59,5 +59,6 @@ else echo ee "\e[32mJava was successfully installed!\e[39m" + echo "Enjoy your new, fresh Java :D (and a coffee, if you didn't drink it yet)" echo fi \ No newline at end of file From 32f9806309f8d2563a370810027144992d308f22 Mon Sep 17 00:00:00 2001 From: Guzio Date: Wed, 8 Apr 2020 23:49:55 +0000 Subject: [PATCH 15/21] HTML typo fixed
-->
I'm going to remove it soon anyway, though, so IDK what's the point of doing that. Signed-off-by: Guzio --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 572e871..4d73536 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Termux Java ### Information -This script will install Java in Termux.
+This script will install Java in Termux.
Libraries compiled by Hax4us, script written by Hax4us and MasterDevX. ### How to use From 383f2b3097ed98efb91b0f285e8cc673d4cd423b Mon Sep 17 00:00:00 2001 From: Guzio Date: Thu, 9 Apr 2020 00:03:18 +0000 Subject: [PATCH 16/21] Cleaned up the mess on README.MD You really like making your life harder, Hax4us and MasterDevX, do you? Not nearly as terrible as on installjava script, but what's the point of using and
? Also, MD loves putting double enters around # marks. I'm not criticising anyone! I also always make my life harder in any possible way. Some people are simply like that and no one can fix it. I just also apparently made some changes to installjava, but I don't know what exactly. It just showed as not saved. Signed-off-by: Guzio --- README.md | 11 ++++++++--- installjava | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4d73536..78f8cca 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,17 @@ [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code%20(for%20some%20reason)-blue?logo=gitpod)](https://gitpod.io/#https://github.com/MasterDevX/Termux-Java) # Termux Java + ### Information -This script will install Java in Termux.
-Libraries compiled by
Hax4us, script written by Hax4us and MasterDevX. + +This script will install Java in Termux. + +Libraries compiled by [Hax4us](https://github.com/Hax4us "Hax4us's GitPod profile"), script written by [Hax4us](https://github.com/Hax4us "Hax4us's GitPod profile") and [MasterDevX](https://github.com/MasterDevX "MasterDevX's GitPod profile"). ### How to use -To install Java, open Termux and execute the following command:
+ +To install Java, open Termux and execute the following command: + ```pkg install wget && wget https://raw.githubusercontent.com/MasterDevX/java/master/installjava && bash installjava``` After that you can run Java using ```java``` command. diff --git a/installjava b/installjava index aaf51eb..e4f6d38 100644 --- a/installjava +++ b/installjava @@ -34,7 +34,7 @@ else esac #Actual installation - ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}... πŸ•›This will take some time, so better make a coffee.πŸ•§" + ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}... πŸ•›This will take some time, so better make a coffee.πŸ•›" wget https://github.com/Hax4us/java/releases/download/${tag}/jdk8_${archname}.tar.gz -q ee "\e[32m[*] \e[34mMoving JDK to system..." @@ -59,6 +59,6 @@ else echo ee "\e[32mJava was successfully installed!\e[39m" - echo "Enjoy your new, fresh Java :D (and a coffee, if you didn't drink it yet)" + echo "Enjoy your new, tasty Java :D (and a coffee, if you didn't drink it yet)" echo fi \ No newline at end of file From 34b4e64d577b9de35567ea54c46aadf6b4a6335b Mon Sep 17 00:00:00 2001 From: Guzio Date: Thu, 9 Apr 2020 00:27:24 +0000 Subject: [PATCH 17/21] Added more instructions to README.MD and credited all contributors. Now it also covers uninstallation and installation with wget. It's easy to keep track of them while there are only 4. Signed-off-by: Guzio --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 78f8cca..37cbcdf 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This script will install Java in Termux. -Libraries compiled by [Hax4us](https://github.com/Hax4us "Hax4us's GitPod profile"), script written by [Hax4us](https://github.com/Hax4us "Hax4us's GitPod profile") and [MasterDevX](https://github.com/MasterDevX "MasterDevX's GitPod profile"). +Libraries compiled by [Hax4us](https://github.com/Hax4us "Hax4us's GitHub profile"), scripts written by [Hax4us](https://github.com/Hax4us "Hax4us's GitHub profile"), [MasterDevX](https://github.com/MasterDevX "MasterDevX's GitHub profile") and [Guzio](https://github.com/GuzioMG "Guzio's GitHub profile"), with some *very, very tiny* help from [Harshiv-Patel](https://Harshiv-Patel "he changed like... one thing"). ### How to use @@ -14,4 +14,12 @@ To install Java, open Termux and execute the following command: ```pkg install wget && wget https://raw.githubusercontent.com/MasterDevX/java/master/installjava && bash installjava``` +> Eventually, run ```wget https://raw.githubusercontent.com/MasterDevX/java/master/installjava && bash installjava``` to install Java if you arleady have ```wget``` installed. + +> Or just ```bash installjava``` if you have the script arleady downloaded for some reason. + +When installed, run ```java -version``` to check, if it's correcty installed (i.e. if it throws command not found error, it's clearly not.) + After that you can run Java using ```java``` command. + +We also provide an uninstaller, but since I'm writing this while making that script, there's no way I can attach a command here, as I need a link for that. Anyway, look for ```uninstall_java.sh``` in repo's home. \ No newline at end of file From 5a2f33469757fd892d3077ef672f0366698732fd Mon Sep 17 00:00:00 2001 From: Guzio <35845447+GuzioMG@users.noreply.github.com> Date: Thu, 9 Apr 2020 15:48:34 +0300 Subject: [PATCH 18/21] Added missing spaces to the installjava script. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Maybe they were causing an issue πŸ˜•? --- installjava | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/installjava b/installjava index e4f6d38..559f139 100644 --- a/installjava +++ b/installjava @@ -17,7 +17,7 @@ then echo exit else - #Checking, whether is someone trying to cheat and simplyfy their installation it on Linux (i.e. x86 (not listad, as you can see) machine) using this script, which have no reason to work. + #Checking, whether is someone trying to cheat and simplyfy their installation it on Linux (i.e. x86 (not listad, as you can see) machine) using this script, which have no reason to work. case `dpkg --print-architecture` in aarch64) archname="aarch64"; tag="v8" ;; @@ -32,33 +32,33 @@ else *) ee "\e[91mERROR: Unknown architecture."; echo; exit ;; esac - - #Actual installation + + #Actual installation ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}... πŸ•›This will take some time, so better make a coffee.πŸ•›" wget https://github.com/Hax4us/java/releases/download/${tag}/jdk8_${archname}.tar.gz -q - + ee "\e[32m[*] \e[34mMoving JDK to system..." mv jdk8_${archname}.tar.gz $PREFIX/share - + ee "\e[32m[*] \e[34mExtracting JDK..." cd $PREFIX/share tar -xhf jdk8_${archname}.tar.gz - - ee "\e[32m[*] \e[34mSeting-up %JAVA_HOME%..." + + ee "\e[32m[*] \e[34mSeting-up %JAVA_HOME%..." export JAVA_HOME=$PREFIX/share/jdk8 - echo "export JAVA_HOME=$PREFIX/share/jdk8" >> $HOME/.profile - + echo "export JAVA_HOME=$PREFIX/share/jdk8" >> $HOME/.profile + ee "\e[32m[*] \e[34mCoping Java wrapper scripts to bin..." #I'm not 100% sure, but getting rid of bin contnent MAY cause some issues with %JAVA_HOME%, thus it's no longer moved - copied instead. Sorry to everyone short on storage. - cp bin/* $PREFIX/bin - + cp bin/* $PREFIX/bin + ee "\e[32m[*] \e[34mCleaning up temporary files..." rm -rf $HOME/installjava rm -rf $PREFIX/share/jdk8_${archname}.tar.gz rm -rf $PREFIX/share/bin - + echo ee "\e[32mJava was successfully installed!\e[39m" - echo "Enjoy your new, tasty Java :D (and a coffee, if you didn't drink it yet)" + echo "Enjoy your new, tasty Java :D (and a coffee, if you didn't drink it yet)" echo -fi \ No newline at end of file +fi From 9cef6fceeebca1f8aed997969e0d989ae89631ab Mon Sep 17 00:00:00 2001 From: Guzio <35845447+GuzioMG@users.noreply.github.com> Date: Thu, 9 Apr 2020 16:23:29 +0300 Subject: [PATCH 19/21] Fixed some more spaces. BRUH! --- uninstall_java.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uninstall_java.sh b/uninstall_java.sh index d5c1cc3..5b33932 100644 --- a/uninstall_java.sh +++ b/uninstall_java.sh @@ -16,10 +16,10 @@ then echo exit else - #Actual uninstallation + #Actual uninstallation ee "\e[32m[*] \e[34mUnseting %JAVA_HOME%..." unset JAVA_HOME=$PREFIX/share/jdk8 - echo "[WARNING!!!]: THIS SCRIPT WILL UNSET THE %JAVA_HOME% >>ONLY TEMPORARILY<>WILL<< CAUSE PROBLEMS IN SOME APPS!!!" + echo "[WARNING!!!]: THIS SCRIPT WILL UNSET THE %JAVA_HOME% >>ONLY TEMPORARILY<>WILL<< CAUSE PROBLEMS IN SOME APPS!!!" ee "\e[32m[*] \e[34mRemoving Java..." rm -drf $PREFIX/share/jdk8 @@ -34,4 +34,4 @@ else echo ee "\e[32mJava was successfully uninstalled!\e[39m" echo -fi \ No newline at end of file +fi From df7f16785997361af844bdf61dd7850290fda05e Mon Sep 17 00:00:00 2001 From: Guzio <35845447+GuzioMG@users.noreply.github.com> Date: Thu, 9 Apr 2020 16:35:44 +0300 Subject: [PATCH 20/21] Hopefully fixed uninstaller Will it work NOW!? --- uninstall_java.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uninstall_java.sh b/uninstall_java.sh index 5b33932..02c041f 100644 --- a/uninstall_java.sh +++ b/uninstall_java.sh @@ -19,7 +19,7 @@ else #Actual uninstallation ee "\e[32m[*] \e[34mUnseting %JAVA_HOME%..." unset JAVA_HOME=$PREFIX/share/jdk8 - echo "[WARNING!!!]: THIS SCRIPT WILL UNSET THE %JAVA_HOME% >>ONLY TEMPORARILY<>WILL<< CAUSE PROBLEMS IN SOME APPS!!!" + echo "WARNING! THIS SCRIPT WILL UNSET THE %JAVA_HOME% ONLY TEMPORARILY! I STRONGLY RECOMEND YOU TO REMOVE \"export JAVA_HOME=$PREFIX/share/jdk8\" LINE FROM YOUR \"$HOME/.profile\" SETUP FILE, AS NOT DOING THAT WILL CAUSE PROBLEMS IN SOME APPS!" ee "\e[32m[*] \e[34mRemoving Java..." rm -drf $PREFIX/share/jdk8 From d073173e85b90cef8a165e2c19d34aff759abfe2 Mon Sep 17 00:00:00 2001 From: Miguel Mota Date: Tue, 8 Sep 2020 22:49:22 -0700 Subject: [PATCH 21/21] Exit immediately on error --- installjava | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) mode change 100644 => 100755 installjava diff --git a/installjava b/installjava old mode 100644 new mode 100755 index 559f139..2183676 --- a/installjava +++ b/installjava @@ -1,6 +1,7 @@ #!/data/data/com.termux/files/usr/bin/bash #Setup +set -e shopt -s expand_aliases alias ee='echo -e' @@ -32,31 +33,31 @@ else *) ee "\e[91mERROR: Unknown architecture."; echo; exit ;; esac - + #Actual installation ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}... πŸ•›This will take some time, so better make a coffee.πŸ•›" wget https://github.com/Hax4us/java/releases/download/${tag}/jdk8_${archname}.tar.gz -q - + ee "\e[32m[*] \e[34mMoving JDK to system..." mv jdk8_${archname}.tar.gz $PREFIX/share - + ee "\e[32m[*] \e[34mExtracting JDK..." cd $PREFIX/share tar -xhf jdk8_${archname}.tar.gz - + ee "\e[32m[*] \e[34mSeting-up %JAVA_HOME%..." export JAVA_HOME=$PREFIX/share/jdk8 echo "export JAVA_HOME=$PREFIX/share/jdk8" >> $HOME/.profile - + ee "\e[32m[*] \e[34mCoping Java wrapper scripts to bin..." #I'm not 100% sure, but getting rid of bin contnent MAY cause some issues with %JAVA_HOME%, thus it's no longer moved - copied instead. Sorry to everyone short on storage. cp bin/* $PREFIX/bin - + ee "\e[32m[*] \e[34mCleaning up temporary files..." rm -rf $HOME/installjava rm -rf $PREFIX/share/jdk8_${archname}.tar.gz rm -rf $PREFIX/share/bin - + echo ee "\e[32mJava was successfully installed!\e[39m" echo "Enjoy your new, tasty Java :D (and a coffee, if you didn't drink it yet)"