Termux-packages: Java-8-jdk+jre{ARM64}

Created on 19 Nov 2017  Â·  73Comments  Â·  Source: termux/termux-packages

FOR ARM64

https://mega.nz/#!TRASgZjR!OdQIhc6Lgls7UUOyMoQaFT6mZq_YW2lcZiFQg3xh0tA

You are free to use but don't take credits

Proof here :- watch
https://asciinema.org/a/z6Egel7sqTZUdCHqDVcROuYLB

Thanks @xeffyr for his Deb's and me to build Java!

Most helpful comment

@SamSanuch Java is available through:

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/install or simply run the following in you 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.

To install java run pacman -Syy; pacman -Su; pacman -S jdk8-openjdk

screenshot_20171109-220204

All 73 comments

I copied these files and restarted Termux, but Can't run java, it says:

/data/data/com.termux/files/usr/bin/java: line 9: /data/data/com.termux/files/usr/share/java-8-jdk/bin/__real_java: cannot execute binary file: Exec format error
/data/data/com.termux/files/usr/bin/java: line 9: /data/data/com.termux/files/usr/share/java-8-jdk/bin/__real_java: Success

This mega link is for Aarch64 only ? Can I have ARMv7l binaries?

@SamSanuch Java is available through:

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/install or simply run the following in you 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.

To install java run pacman -Syy; pacman -Su; pacman -S jdk8-openjdk

screenshot_20171109-220204

@Harshiv-Patel
Yes dude me and @xeffyr supports only aarch64!
You can get the binaries if you know compiling I can send you sources!

@sdrausty
If the java is being built.so,why trying an isolated environment?

@SamSanuch sorry, but I do not understand what you are asking.

I do not have the PC at the hand and I do not know the process required to build it. If you can point me to a guide for setting up environment for this as well as provided links to sources, I can give it a try for ARM v7l. I'd do it later though.

@SamSanuch , isolated environment would give us hassle free workspace, but it limits access to sd/external sd cards, so It's not flexible enough. That approach uses interpretation so it feels laggy for my phone's 1.18GHz CPU, Being able to run binaries directly feels to be more beneficial at the moment.

@Harshiv-Patel
I don't want to know about isolated environment because I know too much and the point regarding that issues in isolated environment is right I'm with you too much issue and slow:)
I'll try to make java 9 and 8 available to arm and arm64

are these statically compiled with glibc?

@SamSanuch there are no problems accessing the sd/external sd cards in PRoot when https://wiki.termux.com/wiki/Termux-setup-storage is setup correctly.

@vishalbiswas
Yes buddy with glibc and what's your telegram or Facebook,etc.

@vishalbiswas
I compiled java 9 with all certs!

screenshot_2017-11-19-12-13-06-049_com termux

screenshot_2017-11-19-12-24-09-135_com termux

Please do build for arm v7l as well.

@Harshiv-Patel
Give me 1.5 hrs and I'll build it:)

@Harshiv-Patel Added support for arm v7l devices

I encounter following output when doing "java" :

java
/data/data/com.termux/files/usr/bin/java: line 8: /data/data/com.termux/files/usr/share/java-8-jdk/bin/__real_java: No such file or directory

I confirmed that the files are in proper place as well as have the necessary permissions(-rwxrwxrwx)
Output stayed same, so I decided to check the "__real_java" with file, the output is:

__real_java: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /data/data/com.termux/files/home/java8/java8arm/gnulib/ld-linux.so, for GNU/Linux 2.6.26, BuildID[sha1]=120db07177774249eac5925cd51bc42cf3033ccd, not stripped

I thought the linker was supposed to be in "$PREFIX/share/gnulib/" but here it was looking in "~/java8/java8arm/gnulib" so I created that directory tree in "~/"  and executed the "java",
now it puts a single word "killed" and exits.

So please fix that --dynamic-linker to point in "$PREFIX/share/gnulib" and provide a version built with "-g" switch, so we can have better debug info.

Extract that in $HOME/java8/

And then execute java

should I put "gnulib" folder in "~/java8/java8arm/" (already tried) or in "~/java8/" ?
Unfortunately both give the same output

Killed

and exit.

mkdir java8
Paste java8arm.zip here and then
unzip java8arm.zip
Restart execute java

And also make sure all the given /bin
Are in $PREFIX/bin

And also make sure all the given /bin
Are in $PREFIX/bin

I am not sure what I'm supposed to do, I have following:

$PREFIX/bin #the contents of outer most "bin" in the zip are here
$PREFIX/share/gnulib #the gnulib of zip here
$PREFIX/share/java-8-jdk #the contents of java8arm.zip/java-8-jdk/ dir here
$~/java8/java8arm/ #everything inside the zip is here as well as java8arm.zip itself

all it says is :

java
/data/data/com.termux/files/usr/bin/java: line 9: /data/data/com.termux/files/usr/share/java-8-jdk/bin/__real_java: Permission denied
/data/data/com.termux/files/usr/bin/java: line 9: /data/data/com.termux/files/usr/share/java-8-jdk/bin/__real_java: Success

Deb file for AArch64 is now available: https://mega.nz/#!2AI1QTSb!7j-zRTva1e38E_uH-5UvU_k1YjbPhRIh8OtsjHKRxJM

Changes:

  • everything was moved to $PREFIX/opt/java-8-jdk (elf interpreter path was adjusted), but wrapper scripts are placed to $PREFIX/bin
  • all ELF files now uses RPATH to find shared libraries
  • wrapper scripts now set property user.home so '.orace_jre_usage' is placed to user home instead of directory with weird name '?'

Later I will do the same deb for ARM.

@Harshiv-Patel
Put gnulib and open-8-jdk folders in $HOME/java8 folder and copy outer most bin to $PREFIX/bin

@xeffyr
Good you made Deb, make for arm also because I can't change one's thinking else you can made an Deb that will directly install it!
I can only compile packages it's on you how to manage it to get working!
And In Termux-Rootfs v4.9 java 8 coming?
Enjoy!

In v4.9 yes.

Yes please, make a .deb, it would be a lot easier then.

On 19 Nov 2017 7:55 pm, "Sam" notifications@github.com wrote:

@xeffyr https://github.com/xeffyr
Good you made Deb, make for arm also because I can't change one's thinking
else you can made an Deb that will directly install it!
In Termux-Rootfs v4.9 java 8 coming?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/termux/termux-packages/issues/1808#issuecomment-345520612,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AYvC14_YUwEZgqBuajyUETq2unlTcDpQks5s4DpsgaJpZM4QjPW-
.

@Harshiv-Patel
Glad to see that you haven't thanked me so far for my work

I have java 9 also but don't know how to make Deb if someone tell me it'll will only beneficial to you because you then directly install that!
@xeffyr I have java 9 also

@SamSanuch in termux-rootfs you can install tool build-deb.

Just make a directory structure like this:

package-dir
.
├── DEBIAN
│   └── control
└── data/data/com.termux/files/usr/{YOUR_STUFF_HERE}

The build with:

build-deb {your_pkg_directory} output.deb

Example of control file for creating package:

Package: java-8-jdk
Maintainer: Leonid Plyushch <[email protected]>
Architecture: aarch64
Installed-Size: 167852
Version: 1.8.0u144
Description: Java 8 development kit

@SamSanuch @xeffyr There's also the python script at https://github.com/termux/termux-create-package which work in a similar way.

@xeffyr
Talk private it's better!

@SamSanuch you know my email, so if you want, you can write on it.

@xeffyr I'm going to update java 8 ARM ARM64 to the latest version and latest gnulibc

@SamSanuch Which version of gnulibc ? I need version num, so I can make gnulibc more compatible with termux environment.

@Grimler91 @xeffyr
Gcc in termux lacks many improvement why not anyone looks on that!?

@SamSanuch GCC is not officially supported in Termux, it was replaced with clang

gnulibc v1.29 something

@SamSanuch you mean 2.26 (latest stable) ?

@xeffyr
Yes dude!

I included gnulibc v2.26 in java 8 arm

Don't send me emails.

On 19-Nov-2017 8:37 pm, "Sam" notifications@github.com wrote:

I included gnulibc v2.26 in java 8 arm

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/termux/termux-packages/issues/1808#issuecomment-345523484,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Acdaoufh43QPAwMwIMGHdubpgVM7lmKjks5s4EQ_gaJpZM4QjPW-
.

one haven't send you emails it's you subscribed termux

Guys, please use gitter for continuous conversation and keep this thread for announcments. It will be much more convenient

@Harshiv-Patel
Glad to see that you haven't thanked me so far for my work

I appreciate your effort. I was trying various combinations of moving folders "gnulib" and "java-8-jdk" to ~/ as well as $PREFIX/share/ and have not been successful ones, So I was(and still I'm) saving a big thanks for the time when "$ java" would give me desired output. Please make a .deb file so that the package installation may become more easier.

Thanks:)
Go to java-8-jdk/bin
Then vim java,etc. But not any file with __real because they are actual binaries

@SamSanuch there is 2 problems with ARM 32bit java.

  1. In your archive ld-linux.so (in gnulib) has invalid permissions. Do chmod 755 to fix.
  2. when I run java, Im receiving output Killed.

So?
You fixed bro?

2 is not fixed.

@xeffyr meet me private

@xeffyr
Wow! I have just send you sources and you build Deb that's nice I'm building java 9 also may you also make Deb's of that sources I'm sending you private just like java8!

Any progress on arm ...?

@Hax4us, currently no progress (and i think that there will not be progress).
And here is the reason: @SamSanuch didn't compile JDK, he got it from Oracle (page: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) which is binary only and there may appear some hidden problems when patch it to work with custom glibc, one of them is that HTTPS is not work in this JDK.

There only two true ways of obtaining JDK:
1. Compile OpenJDK which is in disabled packages
2. Use linux chrooted environment

As JDK 8 from @SamSanuch shouldn't be used I provide OpenJDK 9 compiled from disabled-packages so it does not require gnu libc.

Download links for OpenJDK 9 (JRE, JDK & ca-certificates-java):
\

how to uninstall OpenJDK 8 from termux

For arm, just remove the binaries and libraries manually:
cd to directory first so you don't delete anything else by mistake
cd $PREFIX/share/java-8-jdk
rm -rf *
cd ../gnulib
rm -rf *

Do the same for any files in ~/java8

@xeffyr I am agreed with you . you are right.
@samsanuch just take the binaries and dynamically linked with glibc (which is not good)
And thnx dude for sharing openjdk 9

@xeffyr 's port of Openjdk9 ARM binaries work without any error. Just that zero interpreter seems to slow down it a bit.

@Harshiv-Patel wait until you use it continuously for 30 minutes straight. there's a reason it is in disabled ;)

[23:01 bin ]# pacman -S gradle apache-ant
resolving dependencies...
:: There are 3 providers available for java-environment:
:: Repository extra
   1) jdk7-openjdk  2) jdk8-openjdk  3) jdk9-openjdk

From Arch Linux in Termux on device, which java would you like?

screenshot_2017-11-25-09-57-56-480_com termux

Thanks @SamSanuch @xeffyr it's work fine
Guys

I agree @vishalbiswas , continuous use of openjdk9 JVM causes heavy CPU usage. It should stay in disabled packages for now. Earlier version of OpenJDK9 arm provided by @its-pointless (I hope that's the one) caused linker error "unsupported flags: xxxx" that no longer happen with @xeffyr 's binaries.

As of now java 9 cause battery drainage and slow and have many major bugs too.
Don't question like "what is the bugs test yourself and have an experience"
Java 8 jdk v152 have no network problem as i think the patch you have linked have problems!

If you want super bug free java 9 use @sdrausty method i mean chrooted environment

Yes, there is a high cpu usage.
But what about other bugs... place proof of these bugs here, so others can see them.

@SamSanuch, your Java 8 has more bugs than you think, especially of missing libs (such as libcups, libfontconfig and more linked against gnulibc). Furthermore, java 8 binaries have hardcoded paths to various directories, e.g /usr.

Just inspect libs in directory jre/lib:

~/java8arm/java-8-jdk/jre/lib/arm ➤ ls
client              libawt_xawt.so     libinstrument.so     libjava.so  libjsig.so        libmlib_image.so  libsctp.so          libzip.so
jli                 libbci.so          libj2gss.so          libjawt.so  libjsoundalsa.so  libnet.so         libsplashscreen.so  server
jvm.cfg             libdcpr.so         libj2pcsc.so         libjdwp.so  libjsound.so      libnio.so         libsunec.so
libattach.so        libdt_socket.so    libj2pkcs11.so       libjfr.so   libkcms.so        libnpt.so         libt2k.so
libawt_headless.so  libfontmanager.so  libjaas_unix.so      libjpeg.so  liblcms.so        libresource.so    libunpack.so
libawt.so           libhprof.so        libjava_crw_demo.so  libjsdt.so  libmanagement.so  libsaproc.so      libverify.so
~/java8arm/java-8-jdk/jre/lib/arm ➤ strings * | grep /usr
strings: Warning: 'client' is a directory
strings: Warning: 'jli' is a directory
/usr/X11R6/lib/X11/fonts/TrueType
/usr/X11R6/lib/X11/fonts/truetype
/usr/X11R6/lib/X11/fonts/tt
/usr/X11R6/lib/X11/fonts/TTF
/usr/X11R6/lib/X11/fonts/OTF
/usr/share/fonts/ja/TrueType
/usr/share/fonts/truetype
/usr/share/fonts/ko/TrueType
/usr/share/fonts/zh_CN/TrueType
/usr/share/fonts/zh_TW/TrueType
/usr/X11R6/lib/X11/fonts/Type1
/usr/share/fonts/default/Type1
/usr/X11R6/lib/X11/fonts/TrueType
/usr/X11R6/lib/X11/fonts/truetype
/usr/X11R6/lib/X11/fonts/tt
/usr/X11R6/lib/X11/fonts/TTF
/usr/X11R6/lib/X11/fonts/OTF
/usr/share/fonts/ja/TrueType
/usr/share/fonts/truetype
/usr/share/fonts/ko/TrueType
/usr/share/fonts/zh_CN/TrueType
/usr/share/fonts/zh_TW/TrueType
/usr/X11R6/lib/X11/fonts/Type1
/usr/share/fonts/default/Type1
/usr/share/zoneinfo
:/bin:/usr/bin
/usr/lib/debug

I'm closing this as it's not really an issue to act on - feel free to continue discussion (and/or open a new issue if needed)!

Im curious if any builds for armv7? Im trying to make a app on the go, and sorta need a JDK

Im curious if any builds for armv7?

No builds.
All stuff listed here including download links is outdated and should not be used.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bbtdev picture bbtdev  Â·  3Comments

Zuccace picture Zuccace  Â·  3Comments

thurask picture thurask  Â·  3Comments

ILadis picture ILadis  Â·  3Comments

divyakutty picture divyakutty  Â·  3Comments