Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f03b982

Browse files
committed
Cleaned up that terrible mess in script installjava
Signed-off-by: Guzio <star.master.123.mg@gmail.com>
1 parent 46bfd1b commit f03b982

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎installjava‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22

33
shopt -s expand_aliases
44
alias ee='echo -e'
5+
6+
#Greetings
57
echo
68
ee "\e[93mThis script will install Java in Termux."
79
ee "\e[93mLibraries compiled by \e[32mHax4us\e[93m, script written by \e[32mHax4us \e[93mand \e[32mMasterDevX\e[93m."
810
echo
11+
12+
#Checking for existing Java installation
913
if [ -e $PREFIX/bin/java ]
1014
then
1115
ee "\e[32mJava is already installed!"
1216
echo
1317
exit
1418
else
19+
#Checking, whether is someone trying to cheat and simplyfy their instalLation it on Linux (i.e. x86 (not listad, as you can see) machine)
1520
case `dpkg --print-architecture` in
1621
aarch64)
1722
archname="aarch64"; tag="v8" ;;
@@ -26,19 +31,26 @@ else
2631
*)
2732
ee "\e[91mERROR: Unknown architecture."; echo; exit ;;
2833
esac
34+
35+
#Actual installation
2936
ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}..."
3037
wget https://github.com/Hax4us/java/releases/download/${tag}/jdk8_${archname}.tar.gz -q
38+
3139
ee "\e[32m[*] \e[34mMoving JDK to system..."
3240
mv jdk8_${archname}.tar.gz $PREFIX/share
41+
3342
ee "\e[32m[*] \e[34mExtracting JDK..."
3443
cd $PREFIX/share
3544
tar -xhf jdk8_${archname}.tar.gz
45+
3646
ee "\e[32m[*] \e[34mMoving Java wrapper scripts to bin..."
3747
mv bin/* $PREFIX/bin
48+
3849
ee "\e[32m[*] \e[34mCleaning up temporary files..."
3950
rm -rf $HOME/installjava
4051
rm -rf $PREFIX/share/jdk8_${archname}.tar.gz
4152
rm -rf $PREFIX/share/bin
53+
4254
echo
4355
ee "\e[32mJava was successfully installed!\e[39m"
4456
echo

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /