OpenJDK for OpenWrt
11 March 2023 -
4 mins read time
Tags:
OpenWrt
OpenJDK
JDK
Java
Page not found or adblock is active!
(1) Type URL correctly
(2) Enable javascript
(3) Disable adblock software, extensions, DNS, etc.
(4) Try another browser.
Then you can go to Home or go back to previous page.
Back to Previous PageTutorial Bahasa Indonesia
Jalankan OpenJDK di OpenWrt (musl-based)
- Script pada tutorial Reinhart Previano s’ hanya bekerja untuk jdk8 dan jdk11 dengan versi lawas dari paket JDK yang ada.
- Script dari josedelinux akan otomatis mengunduh OpenJDK di OpenWrt, tetapi terlalu rumit karena harus menyiapkan beberapa pengaturan terlebih dahulu, dia menggunakan java untuk server Minecraft (papermc).
- Script versi Helmi Amirudin menyediakan:
- Instalasi mudah.
- Mendukung banyak platform perangkat (architectures).
- Bisa memilih versi OpenJDK sesuai selera (seperti jdk8,jdk9 or something else).
- Bisa memilih versi rilisan OpenJDK (you can get version number from
Informasi Dukungan
-
Mendukung architectures dibawah ini:
aarch64armhfarmv7ppc64les390xx86this 32bitx86_64
- Mendukung versi OpenJDK:
jdk8~jdk17 - Mendukung rilis versi OpenJDK:
v3.0~v3.17
Persiapan
- Koneksi internet
- Penyimpanan kosong lebih dari 800mb
Pemasangan
- Buka Putty/Terminal/TTYD/XTERM or similar apps like these.
-
Jalankan perintah terminal di bawah ini untuk mengunduh script
installjdkke OpenWRT (pilih salah satu dari kedua cara dibawah):wgetinstallation:wget https://raw.githubusercontent.com/helmiau/openwrt-jdk/main/installjdk.sh -O /root/installjdk && chmod +x /root/installjdkcurlinstallation:curl -sL https://raw.githubusercontent.com/helmiau/openwrt-jdk/main/installjdk.sh > /root/installjdk && chmod +x /root/installjdk -
Jalankan perintah instalasi, seperti contoh berikut (sesuaikan dengan perangkat masing-masing):
Informasi perintah:
./installjdk device_architecture jdk_version release_version- Ganti
device_architecturedengan arsitektur perangkatmu dari daftarMendukung architectures dibawah inidiatas. - Ganti
jdk_versiondengan ``versi OpenJDK` diatas. - Ganti
release_versiondenganrilis versi OpenJDKdiatas.
Contoh:
Saya ingin memasang openjdk8 untuk x86 32-bit dengan rilisan openjdk terbaru, maka jalankan:
./installjdk x86 jdk8Saya ingin memasang openjdk11 untuk aarch64 dengan versi rilis v3.14, maka jalankan:
./installjdk aarch64 jdk11 v3.14 - Ganti
- Reboot lalu jalankan
java -versiondi terminal untuk melihat versi Java yang terpasang.
English Tutorial
Run OpenJDK on OpenWrt (musl-based)
- Reinhart Previano s’ tutorial is for jdk8 and jdk11 script only with older packages links
- josedelinux scripts will automatically download
musl-basedOpenJDK to current directory, it works on my raspberry pi 3b+ , my Minecraft server(papermc) works fine too - My improvements will do:
- Easy-install.
- Support multiple platform (architectures).
- Selectable OpenJDK version (like jdk8,jdk9 or something else).
- Selectable OpenJDK release version (you can get version number from
Supported Information
-
Available supported device architectures:
aarch64armhfarmv7ppc64les390xx86this 32bitx86_64
- Available OpenJDK version:
jdk8~jdk17 - Available OpenJDK release version:
v3.0~v3.17
Requirements
- Internet connection
- Empty storage space more than 800mb
Installation
- Open Putty/Terminal/TTYD/XTERM or similar apps like these.
-
Run commands below to download
installjdkscript to your OpenWRT (choose one of installation method below):wgetinstallation:wget https://raw.githubusercontent.com/helmiau/openwrt-jdk/main/installjdk.sh -O /root/installjdk && chmod +x /root/installjdkcurlinstallation:curl -sL https://raw.githubusercontent.com/helmiau/openwrt-jdk/main/installjdk.sh > /root/installjdk && chmod +x /root/installjdk -
Select one of below sample installation:
Command informations:
./installjdk device_architecture jdk_version release_version- Replace
device_architecturewith your device arhitecture fromsupported device architecturesabove. - Replace
jdk_versionwith ``OpenJDK version` above. - Replace
release_versionwithOpenJDK release versionabove.
Example(s):
i want to install openjdk8 for x86 32-bit with latest release version, then i run:
./installjdk x86 jdk8i want to install openjdk11 for aarch64 with release version v3.14, so i run:
./installjdk aarch64 jdk11 v3.14 - Replace
- Reboot and run
java -versionon terminal to see installed java version on your machine.
Known Bugs
- Java with SSL Certificate is still bug, so you can run java app containing ssl certificate like this issue Failed to get extensions from GitHub caused by the trustAnchors parameter must be non-empty
References
- josedelinux/openwrt-jdk
- Reinhart Previano’s blog
- Adoptium Temurin OpenJDK Build Doc
- opkg checker and installer, internet checker, vpn manager, gmt selection codes by Helmi Amirudin