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:
aarch64
armhf
armv7
ppc64le
s390x
x86
this 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
installjdk
ke OpenWRT (pilih salah satu dari kedua cara dibawah):wget
installation:wget https://raw.githubusercontent.com/helmiau/openwrt-jdk/main/installjdk.sh -O /root/installjdk && chmod +x /root/installjdk
curl
installation: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_architecture
dengan arsitektur perangkatmu dari daftarMendukung architectures dibawah ini
diatas. - Ganti
jdk_version
dengan ``versi OpenJDK` diatas. - Ganti
release_version
denganrilis versi OpenJDK
diatas.
Contoh:
Saya ingin memasang openjdk8 untuk x86 32-bit dengan rilisan openjdk terbaru, maka jalankan:
./installjdk x86 jdk8
Saya ingin memasang openjdk11 untuk aarch64 dengan versi rilis v3.14, maka jalankan:
./installjdk aarch64 jdk11 v3.14
- Ganti
- Reboot lalu jalankan
java -version
di 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-based
OpenJDK 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:
aarch64
armhf
armv7
ppc64le
s390x
x86
this 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
installjdk
script to your OpenWRT (choose one of installation method below):wget
installation:wget https://raw.githubusercontent.com/helmiau/openwrt-jdk/main/installjdk.sh -O /root/installjdk && chmod +x /root/installjdk
curl
installation: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_architecture
with your device arhitecture fromsupported device architectures
above. - Replace
jdk_version
with ``OpenJDK version` above. - Replace
release_version
withOpenJDK release version
above.
Example(s):
i want to install openjdk8 for x86 32-bit with latest release version, then i run:
./installjdk x86 jdk8
i want to install openjdk11 for aarch64 with release version v3.14, so i run:
./installjdk aarch64 jdk11 v3.14
- Replace
- Reboot and run
java -version
on 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