https://github.com/josedelinux/openwrt-jdk
Script that downloads and installs OpenJDK on OpenWrt
https://github.com/josedelinux/openwrt-jdk
openjdk openwrt shell-script
Last synced: about 2 months ago
JSON representation
Script that downloads and installs OpenJDK on OpenWrt
- Host: GitHub
- URL: https://github.com/josedelinux/openwrt-jdk
- Owner: josedelinux
- Created: 2021-07-31T05:20:40.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-08-22T13:15:33.000Z (almost 3 years ago)
- Last Synced: 2025-03-24T14:44:33.241Z (about 1 year ago)
- Topics: openjdk, openwrt, shell-script
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 32
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shell script to get and run musl-based OpenJDK from Alpine package on your OpenWrt router.
This scripts will automatically download musl-based OpenJDK to current directory
The release page provides compressed tar files for offline installation. These tar file are just untar and tar back gzip tarballs
It works on my raspberry pi 3b+ , my Minecraft server(papermc) works fine as well.
Inspired from [Reinhart Previano s' blog](https://dev.to/reinhart1010/apparently-yes-you-can-install-openjdk-java-jre-and-yacy-on-openwrt-1e33) , update packages links
## Get openjdk(optional)
run `./dljdk8.sh` or `./dljdk11.sh`
## Installation
1. go to [Release page](https://github.com/josedelinux/openwrt-jdk/releases/) to download OpenJDK according to your architecture
2. Make a directory for the JDK: `mkdir -p /usr/lib/jvm`
3. Extract the archive: `tar zxvf openjdk-version_arch.tar.gz -C /usr/lib/jvm`
4. add `export PATH="/usr/lib/jvm/bin:$PATH"` to `/etc/profile`
5. reboot and then test java with `java --version`
## Troubleshooting
### Compatibility issue
```stderr
Error relocating /usr/lib/jvm/lib/aarch32/jli/libjli.so: __dlsym_time64: symbol not found
Error relocating /usr/lib/jvm/lib/aarch32/jli/libjli.so: __gettimeofday_time64: symbol not found
Error relocating /usr/lib/jvm/lib/aarch32/jli/libjli.so: __stat_time64: symbol not found
```
As mentioned in [#1](https://github.com/josedelinux/openwrt-jdk/issues/1), this is probably is because your device is using musl version older than v1.2.0.
in that case you will need to use the alpine package before [v3.13](https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.13.0), which still uses musl 1.1.
#### Solution
here is a [install script](https://gist.github.com/stokito/7dd425da5a12abce8b39dda1bd1106d7) written by [Sergey Ponomarev](https://github.com/stokito)
## Better solution(todo)
### Packaging it as an OPKG package for easier installation.
### Building packages from source
---
This repo is **no longer actively maintained** as I stopped tinkering around on my router.