|
1 | 1 | #!/data/data/com.termux/files/usr/bin/bash
|
2 | 2 |
|
3 | 3 | #Setup
|
| 4 | +set -e |
4 | 5 | shopt -s expand_aliases
|
5 | 6 | alias ee='echo -e'
|
6 | 7 |
|
|
32 | 33 | *)
|
33 | 34 | ee "\e[91mERROR: Unknown architecture."; echo; exit ;;
|
34 | 35 | esac
|
35 | | - |
| 36 | + |
36 | 37 | #Actual installation
|
37 | 38 | ee "\e[32m[*] \e[34mDownloading JDK-8 (~70Mb) for ${archname}... 🕛This will take some time, so better make a coffee.🕛"
|
38 | 39 | wget https://github.com/Hax4us/java/releases/download/${tag}/jdk8_${archname}.tar.gz -q
|
39 | | - |
| 40 | + |
40 | 41 | ee "\e[32m[*] \e[34mMoving JDK to system..."
|
41 | 42 | mv jdk8_${archname}.tar.gz $PREFIX/share
|
42 | | - |
| 43 | + |
43 | 44 | ee "\e[32m[*] \e[34mExtracting JDK..."
|
44 | 45 | cd $PREFIX/share
|
45 | 46 | tar -xhf jdk8_${archname}.tar.gz
|
46 | | - |
| 47 | + |
47 | 48 | ee "\e[32m[*] \e[34mSeting-up %JAVA_HOME%..."
|
48 | 49 | export JAVA_HOME=$PREFIX/share/jdk8
|
49 | 50 | echo "export JAVA_HOME=$PREFIX/share/jdk8" >> $HOME/.profile
|
50 | | - |
| 51 | + |
51 | 52 | ee "\e[32m[*] \e[34mCoping Java wrapper scripts to bin..."
|
52 | 53 | #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.
|
53 | 54 | cp bin/* $PREFIX/bin
|
54 | | - |
| 55 | + |
55 | 56 | ee "\e[32m[*] \e[34mCleaning up temporary files..."
|
56 | 57 | rm -rf $HOME/installjava
|
57 | 58 | rm -rf $PREFIX/share/jdk8_${archname}.tar.gz
|
58 | 59 | rm -rf $PREFIX/share/bin
|
59 | | - |
| 60 | + |
60 | 61 | echo
|
61 | 62 | ee "\e[32mJava was successfully installed!\e[39m"
|
62 | 63 | echo "Enjoy your new, tasty Java :D (and a coffee, if you didn't drink it yet)"
|
|
0 commit comments