Closed ghost closed 3 years ago
AWESOME! Thanks! I love Arch Linux, this helps immensely.
On Fri, Nov 10, 2017, 4:25 AM S D Rausty notifications@github.com wrote:
@AravK https://github.com/aravk Java is available through: TermuxArch https://github.com/sdrausty/TermuxArch
Now you can install Arch Linux in Termux 📲 on your smartphone and tablet. More information at https://sdrausty.github.io/TermuxArch
Java is available through https://sdrausty.github.io/TermuxArch/ Just follow the easy install instructions at https://sdrausty.github.io/TermuxArch/docs/docs/install or simply copy and paste the following into your Termux window:
cd && git clone https://github.com/sdrausty/TermuxArch ./TermuxArch/setupTermuxArch.sh
Read more about the Arch Linux package manager at duckduckgo arch+linux+install+java+pacman. https://duckduckgo.com/?q=arch+linux+install+java+pacman&atb=v90-2__&t=cros&ia=qa
To install java run pacman -Syy; pacman -Su; pacman -S jdk8-openjdk
[image: screenshot_20171109-220204] https://user-images.githubusercontent.com/27742457/32641053-cedfdcfe-c599-11e7-9c73-b185e70e9c6a.png [image: screenshot_20171109-222326] https://user-images.githubusercontent.com/27742457/32641590-d5541d4a-c59c-11e7-8855-e151bc217acc.png
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/termux/termux-packages/issues/324#issuecomment-343364440, or mute the thread https://github.com/notifications/unsubscribe-auth/ARILTo9TZNzA9CfXca0rV6UTzcfHDDPBks5s08IbgaJpZM4I2K8f .
--
AK
That is awsome , I have been waiting this for months now.
Use
useradd username
. Thencp -r arch/root/ arch/username
. Finallysu - username
and similar to login as user, not the root account of your Arch Linux in Termux installation and similar.
From https://github.com/sdrausty/TermuxArch/issues/26 "...use makepkg to build packages" which should be useful for user and permission issues with Termux-app and Termux-packages.
Please direct PRoot in Termux issues https://github.com/termux/proot here. Comments regarding setupTermuxArch.sh
should be directed to https://github.com/sdrausty/TermuxArch/issues. setupTermuxArch.sh
creates system information when requested. Run setupTermuxArch.sh --sysinfo
and post this information along with your input and complete output if necessary. Also include a screenshot if it will help in resolving the issue.
@AravK @EralpCelebi Thank you for your compliments! Hopefully you are inspired with Arch Linux in Termux PRoot and Termux on device as well as I am. A new website regarding Arch Linux in Termux PRoot is being built at https://sdrausty.github.io/TermuxPovray/ regarding https://github.com/termux/termux-packages/issues/202 Package request: povray.
Created on device in Termux from https://github.com/termux/termux-packages/issues/202 Package request: povray.
If you use DexClassLoader make sure to prevent System.exit calls from crashing the whole app.
Oracle jdk8 install on termux:---- 1)(Termux updare and upgrade) $ apt update && upgrade -y
2)(package Install) $ pkg install $ pkg install git $ pkg install lftp proot
3)(Jdk download on Oracle site, hflt.tar.gz type jdk file download) http://www.oracle.com/technetwork
then code paste in termux
$ cd && git clone https://github.com/sdrausty/TermuxArch
$ ./TermuxArch/setupTermuxArch.sh Sometime consume to installation after installation:-
$ exit
$ startarch
$ rm -r TermuxArch
$ cd arch
5)(copy java file sdcard to arch terminal) go to mobile setting ----> install apps ---> termux access storage permissions ----"on"... then paste the code on termux $ cp /sdcard/Download/jdk-8u212-linux-arm64-vfp-hflt.tar.gz .
6)(then java install in arch go to file location ware you java install and paste the code) $ pacman -S sudo -y $ sudo tar xvzf jdk-8u212-linux-arm64-vfp-hflt.tar.gz
7)(java path sate) $ sudo nano /etc/profile.d/jdk1.8.0_212.sh
8)(then nano pad open then type java location) export JAVA_HOME="/jdk1.8.0_212" export PATH="$PATH:${JAVA_HOME}/bin"
(type alt +x ---> y "To save" then press enter that's all) $ exit $ exit Reopen termux $ startarch $ cd arch
$ echo $JAVA_HOME $ echo $PATH
Then Type "java -version" Java(TM) SE Runtime Environment (build 1.8.0_212-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.212-b10, mixed mode)
Hello eveyone. This is just a poke to see if there is any movement on this topic. It seems like some people are using ejc as a replacement for javac. I will be reading and catching up on how to compile the JDK.
@CRamsan , many of the most used tools in JDK like javac, javah etc are written in java, that are not as difficult to bring to android as porting the runtime environment, which is written in native languages and APIs per OS.
many of the most used tools in JDK like javac, javah etc are written in java
Significant part of OpenJDK is written in C++ and has problems when compiling with clang from Android NDK (starting from NDK r18).
I suppose a simple yet difficult way to deal with such a problem is to make a list of problematic functions and deal them one by one, handling all the API differences ?
@CRamsan
It seems like some people are using
ejc
as a replacement forjavac
.
I will be reading and catching up on how to compile the JDK.
Did you go beyond that?
Hello everyone, just wanted to ask if there has been any new development on this.
there has been any new development on this.
If package request tagged as help wanted
, then Termux maintainers can't handle it. Pull requests are wanted.
Ah I didn't notice that, thanks for the info.
So, i highly suggest looking at Minecraft JE on Android launchers. They managed to get JRE 8 working on android. Will it help, though?
They managed to get JRE 8 working on android. Will it help, though?
The only thing that will help is a submission of script and patches for cross-compiling JDK for Android OS (Termux). Until that, JDK may never be ported.
Read my previous comment.
https://github.com/AOF-Dev/openjdk-aarch64-jdk8u-androidport Don't know about building though
@artdeell Your repository link is neither official OpenJDK sources nor has anything that will help to create a proper build script for Termux.
See https://github.com/termux/termux-packages/tree/667fce5a65eaf163ed05a65dce9fb0d587b46301/disabled-packages/openjdk-9-jre-headless (but updated at least to Java 11 & fixed for latest Clang-based NDK) to know what we are looking for.
check out my fork of the run_java repository (that uses dx/ecj).
My version comes from a fork which added support for class filenames (.class instead of .dex), but didn't support multiple input arguments.
I was able to get this fixed and working with multi-arg support
(aka: javac *.java
or javac fileA.java fileB.java ... fileN. java
of course it's not going to make actual compiled Java .class files run, but it does function identically when compiling/running (tab autocompetion works)
idn if anyone is even still thinking about / cares about this anymore, but maybe it will make someone happy 😊
If it can run a minecraft server then it is good enough for me!
On Wed, Nov 4, 2020 at 11:53 AM hltdev8642 notifications@github.com wrote:
check out my fork https://github.com/hltdev8642/run_java of the run_java https://github.com/zaoqi-clone/run_java repository (that uses dx/ecj).
My version comes from a fork which added support for class filenames (.class instead of .dex), but didn't support multiple input arguments.
I was able to get this fixed and working with multi-arg support (aka: javac *.java or javac fileA.java fileB.java ... fileN. java
of course it's not going to make actual compiled Java .class files run, but it does function identically when compiling/running (tab autocompetion works)
idn if anyone is even still thinking about / cares about this anymore, but maybe it will make someone happy 😊
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/termux/termux-packages/issues/324#issuecomment-721941486, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFYTD5HUOZAZ4J4MB4WAAKTSOGWMVANCNFSM4CGYV4PQ .
Maybe!!!, however I doubt it as I dont think that it deals with jar files (and you couldnt just extract it, as the method being used in the run_java repo is basically just creating .dex files and renaming them so they basically just look "like" a standard java class file.
If you want to run a minecraft server on Android that's not all too hard
the thing is, is that it is not really running java/javac in the traditional way, but just linking filenames to the android binaries dx
and ecj
(compile dex (android-formatted) src code).
but good luck, who knows it may work :D
TL;DR I create an ubuntu proot, where I install the openjdk. Back in termux I create a bash script named "java" which, when called, forwards to the real java within the ubuntu proot by using the proot command.
How Set up the ubuntu-20.04 proot (more info here):
pkg install proot-distro
proot-distro list #(check ubuntu versions available)
proot-distro install ubuntu-20.04
proot-distro login ubuntu-20.04
Within the ubuntu distro install the openjdk:
apt update
apt upgrade
apt install openjdk-8-jdk
(I suppose this also works with later versions of the openjdk.)
Return to termux (press Ctrl-D)
Add the following line in ~/.bashrc
export UBUNTU=$PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu-20.04/
From the bash or fish prompt you can do this using the following command:
echo "export UBUNTU=\$PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu-20.04/" >> ~/.bashrc
Restart the termux session so that .bashrc is executed and the variable $UBUNTU is set.
Create the script file "java" in ~/../usr/bin/ with the following content:
#!/usr/bin/bash
unset LD_PRELOAD
proot -R $UBUNTU java "$@"
From the fish prompt you can do this using the following command:
echo "#!/usr/bin/bash
unset LD_PRELOAD
proot -R \$UBUNTU java \"\$@\" " >> ~/../usr/bin/java
(I don't know how to do this from the bash prompt)
For more information about the proot command, check the manual.
Make the script "java" executable:
chmod 777 ../usr/bin/java
You can now call java with arguments from termux. I suppose you can do the same trick for javac.
I would be happy to hear about your suggestions for improvement.
workaround for having java in termux
TL;DR I create an ubuntu proot, where I install the openjdk. Back in termux I create a bash script named "java" which, when called, forwards to the real java within the ubuntu proot by using the proot command.
How Set up the ubuntu-20.04 proot (more info here):
pkg install proot-distro proot-distro list #(check ubuntu versions available) proot-distro install ubuntu-20.04 proot-distro login ubuntu-20.04
Within the ubuntu distro install the openjdk:
apt update apt upgrade apt install openjdk-8-jdk
(I suppose this also works with later versions of the openjdk.)
Return to termux (press Ctrl-D)
Add the following line in ~/.bashrc
export UBUNTU=$PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu-20.04/
From the bash or fish prompt you can do this using the following command:echo "export UBUNTU=\$PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu-20.04/" >> ~/.bashrc
Restart the termux session so that .bashrc is executed and the variable $UBUNTU is set.Create the script file "java" in ~/../usr/bin/ with the following content:
#!/usr/bin/bash unset LD_PRELOAD proot -R $UBUNTU java "$@"
From the fish prompt you can do this using the following command:
echo "#!/usr/bin/bash unset LD_PRELOAD proot -R \$UBUNTU java \"\$@\" " >> ~/../usr/bin/java
(I don't know how to do this from the bash prompt)
For more information about the proot command, check the manual.
Make the script "java" executable:
chmod 777 ../usr/bin/java
You can now call java with arguments from termux. I suppose you can do the same trick for javac.
I would be happy to hear about your suggestions for improvement.
genius
the only problem i have is the command is a bit long
now to compile
on a sem-related note, the mentioned method linking to proot has worked for me not only with Java/Javac, but also ant and a whole handful of other programs. so props to @ronnac for that :-)
is it possile to have it open the ubuntu thing on startup?
JDK is available as package openjdk-17
.
That is almost fantastic news; alas:javaError occurred during initialization of VMjava.lang.StackOverflowError       at java.lang.String.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
@ronnac that issue is being worked on. https://github.com/termux/termux-packages/issues/7214
Please add the Java compilers (java, javac, jar, etc.)