termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.33k stars 3.07k forks source link

[Package]: openjdk-21 #17978

Closed AntonPieper closed 4 weeks ago

AntonPieper commented 1 year ago

Why is it worth to add this package?

OpenJDK-21 is now the latest LTS release. It makes sense to add the LTS versions to termux.

Home page URL

https://openjdk.org/projects/jdk/21/

Source code URL

https://github.com/openjdk/jdk21

Packaging policy acknowledgement

Additional information

No response

itsaky commented 1 year ago

This might be helpful:

oldcwj commented 11 months ago

This might be helpful:

can this build success?

itsaky commented 11 months ago

This might be helpful:

can this build success?

With termux-packages' build system, yes. I didn't try to build a standalone version.

I built version 21.0.0 successfully. OpenJDK 21.0.1 has also been merged in openjdk-21-android after that. The patches should be compatible, but I haven't tested the build yet.

oldcwj commented 11 months ago

This might be helpful:

can this build success?

With termux-packages' build system, yes. I didn't try to build a standalone version.

I built version 21.0.0 successfully. OpenJDK 21.0.1 has also been merged in openjdk-21-android after that. The patches should be compatible, but I haven't tested the build yet.

root@vultr:~/termux-packages# ./scripts/run-docker.sh ./build-package.sh openjdk-21 Running container 'termux-package-builder' from image 'ghcr.io/termux/package-builder'... termux - building openjdk-21 for arch aarch64... ERROR: Package libfcft depends on non-existing package "libxkbcommon" ERROR: Obtaining buildorder failed

libxkbcommon already installed

@itsaky

itsaky commented 11 months ago

root@vultr:~/termux-packages# ./scripts/run-docker.sh ./build-package.sh openjdk-21 Running container 'termux-package-builder' from image 'ghcr.io/termux/package-builder'... termux - building openjdk-21 for arch aarch64... ERROR: Package libfcft depends on non-existing package "libxkbcommon" ERROR: Obtaining buildorder failed

I don't know what's causing this issue, but you can try to build openjdk-21 without the libfcft package ( openjdk-21 doesn't seem to be dependent on libfcft directly or indirectly).

Please note that the fork I have mentioned here has been patched to build the packages for AndroidIDE. So, if you build any package with that fork, the packages won't work in Termux (hardcoded package name).

In my opinion, if you plan to use OpenJDK 21 in Termux, you should:

  1. Clone termux/termux-packages.
  2. Copy openjdk-21 from itsaky/termux-packages to termux/termux-packages you cloned.
  3. Build openjdk-21 in termux/termux-packages.

Also, I made the following changes to the installation procedure for both openjdk-17 and openjdk-21 in my fork:

These changes might affect existing openjdk-17 installation.

itsaky commented 11 months ago

@oldcwj

I forgot to mention that you may face some issues with the linking process while building libidn2. However, you can execute build-package.sh with -I flag to download the pre-built libidn2 package from the package repository.

oldcwj commented 11 months ago

@itsaky Thank you for your reply.

ivivanov-bg commented 8 months ago

Any update on this - I see jdk21 is still not available

Icedude907 commented 3 months ago

How about openjdk 22 while we're at it?

jarryzeng commented 2 months ago

how do you guys pass the configure --with-boot-jdk? when im at the step of configure it will give me all of this log:

configure: Found potential Boot JDK using configure arguments
configure: Potential Boot JDK found at /data/data/com.termux/files/home/jdk-21 is not a working JDK; ignoring
configure: Output from java -version was: /data/data/com.termux/files/home/openjdk-21-android/build/.configure-support/generated-configure.sh: line 68184: /data/data/com.termux/files/home/jdk-21/bin/java: cannot execute: required file not found
configure: error: The path given by --with-boot-jdk does not contain a valid Boot JDK
configure exiting with result code 1

I have tried using jdk21, jdk21.0.1, and jdk22 but they are give me all the same result i dont know how to do right now

(edit) i found a paper to tell me open the proot-distro i finished this problem thanks

gphg commented 1 month ago

This is helpful. Thanks. 👍

zph95 commented 1 month ago

I use OpenJdk-21-and-alot-of-debs.zip, unzip and dpkg -i openjdk-21_21.0.1_aarch64.deb. The jdk21 would installed at /data/data/com.termux/files/usr/opt/openjdk-21.0.1.
I try it , it just works fine.

./java --version openjdk 21.0.1-internal 2023-10-17 OpenJDK Runtime Environment (build 21.0.1-internal-adhoc.root.src) OpenJDK 64-Bit Server VM (build 21.0.1-internal-adhoc.root.src, mixed mode)

twaik commented 4 weeks ago

Fixed by 169241ab2834c6056ee15faae4c5efd1d794ef72.