Problem installing Java Installer on Synology NAS

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
nickleigh78
Posts: 7
Joined: 27 Aug 2019, 08:24

Re: Problem installing Java Installer on Synology NAS

Post by nickleigh78 »

Hello,

Thanks for the reply. I added the Rednoah Java & FileBot Repository to DSM Package Manager (https://get.filebot.net/syno/) a long time ago, probably around Java 17 on this NAS, and added the Java Installer package. As far as memory serves, it was a rednoah developer and rednoah publisher but now it is not....

https://www.dropbox.com/scl/fi/d5rpouq5 ... zydt5&dl=0

I have uninstalled the package and will wait for your response regarding the output of

Code: Select all

cat /volume1/@appstore/java-installer/get-java.sh

Code: Select all

#!/bin/sh

# Java Installer for OpenJDK 21.0.3

COMMAND=${1:-get}        # get | install
TYPE=${2:-jdk}           # jre | jdk
ARCH=${3:-`uname -m`}    # x86_64 | i686 | aarch64 | armv7l | etc
OS=${4:-`uname -s`}      # Linux | Darwin | Windows | etc

case "$OS $ARCH $TYPE" in
	"Linux x86_64 jdk")
		JDK_URL="https://ghproxy.cn/https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.2%2B7/OpenJDK23U-jdk_x64_linux_hotspot_23.0.2_7.tar.gz"
		JDK_SHA256="870ac8c05c6fe563e7a3878a47d0234b83c050e83651d2c47e8b822ec74512dd"
	;;
	"Linux i686 jdk")
		JDK_URL="https://download.bell-sw.com/java/21.0.3+10/bellsoft-jdk21.0.3+10-linux-i586.tar.gz"
		JDK_SHA256="9379b368034b095cf0af15b6aa5a6a3548cd1e3aef32e8db6a7409fd3de12375"
	;;
	"Linux aarch64 jdk")
		JDK_URL="https://ghproxy.cn/https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.2%2B7/OpenJDK23U-jdk_aarch64_linux_hotspot_23.0.2_7.tar.gz"
		JDK_SHA256="fb43ae1202402842559cb6223886ec1663b90ffbec48479abbcb92c92c9012eb"
	;;
	"Linux armv7l jdk")
		JDK_URL="https://download.bell-sw.com/java/21.0.3+10/bellsoft-jdk21.0.3+10-linux-arm32-vfp-hflt.tar.gz"
		JDK_SHA256="cdb909ec6afe0a0a003e5214904cf6efae967150649ae351c54fe40487317fb0"
	;;
	"Linux ppc64le jdk")
		JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.3_9.tar.gz"
		JDK_SHA256="9a1079d7f0fc72951fdc9a0029e49a15f6ba114683aee626f882ee2c761f1d57"
	;;
	"Linux riscv64 jdk")
		JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_riscv64_linux_hotspot_21.0.3_9.tar.gz"
		JDK_SHA256="246acb1db3ef69a7e3328fa378513b2e606e64710626ae8dd29decc0e525359b"
	;;

	"Darwin x86_64 jdk")
		JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_x64_mac_hotspot_21.0.3_9.tar.gz"
		JDK_SHA256="f777103aab94330d14a29bd99f3a26d60abbab8e2c375cec9602746096721a7c"
	;;
	"Darwin arm64 jdk")
		JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.3_9.tar.gz"
		JDK_SHA256="b6be6a9568be83695ec6b7cb977f4902f7be47d74494c290bc2a5c3c951e254f"
	;;

	"Windows x86_64 jdk")
		JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_x64_windows_hotspot_21.0.3_9.zip"
		JDK_SHA256="c43a66cff7a403d56c5c5e1ff10d3d5f95961abf80f97f0e35380594909f0e4d"
	;;
	"Windows x86 jdk")
		JDK_URL="https://download.bell-sw.com/java/21.0.3+10/bellsoft-jdk21.0.3+10-windows-i586.zip"
		JDK_SHA256="8dd427b20d6f8bcb66d43bbd6a4dc5b5433f9554a38017d1b1cc6a8c0568387d"
	;;
	"Windows aarch64 jdk")
		JDK_URL="https://download.bell-sw.com/java/21.0.3+10/bellsoft-jdk21.0.3+10-windows-aarch64.zip"
		JDK_SHA256="ac148b0fbfe253bcd449399371a6bd491f9f23a0a67b3bd920657e4f9470578a"
	;;

	"Linux x86_64 jfx")
		JDK_URL="https://download2.gluonhq.com/openjfx/21.0.3/openjfx-21.0.3_linux-x64_bin-jmods.zip"
		JDK_SHA256="62c92a586a53c7169b8cdbc1a21b86be0c438e2e8786c4df11bfcb2cca69aa8f"
	;;

	"Darwin x86_64 jfx")
		JDK_URL="https://download2.gluonhq.com/openjfx/21.0.3/openjfx-21.0.3_osx-x64_bin-jmods.zip"
		JDK_SHA256="0a12ad01d8450437be3608175428b336f94bc8446123e804ae99d2d09a158a76"
	;;
	"Darwin arm64 jfx")
		JDK_URL="https://download2.gluonhq.com/openjfx/21.0.3/openjfx-21.0.3_osx-aarch64_bin-jmods.zip"
		JDK_SHA256="61e78370159e22902ce5a8224e278d02a9f1471aff56e2cef0fba30709a07d21"
	;;

	"Windows x86_64 jfx")
		JDK_URL="https://download2.gluonhq.com/openjfx/21.0.3/openjfx-21.0.3_windows-x64_bin-jmods.zip"
		JDK_SHA256="f66cb1b4f027164544b059c3aed503890df94602163740236e2f3c2fab0cb0cd"
	;;

	*)
		echo "Architecture not supported: $OS $ARCH $TYPE"
		exit 1
	;;
esac


# fetch JDK
JDK_TAR_GZ=${5:-`basename $JDK_URL`}

if [ ! -f "$JDK_TAR_GZ" ]; then
	echo "Download $JDK_URL"
	curl -fsSL -o "$JDK_TAR_GZ" --retry 5 "$JDK_URL"
fi


# verify archive via SHA-256 checksum
JDK_SHA256_ACTUAL=`openssl dgst -sha256 -hex "$JDK_TAR_GZ" | awk '{print $NF}'`
echo "Expected SHA256 checksum: $JDK_SHA256"
echo "Actual SHA256 checksum: $JDK_SHA256_ACTUAL"

if [ "$JDK_SHA256" != "$JDK_SHA256_ACTUAL" ]; then
	echo "ERROR: SHA256 checksum mismatch"
	exit 1
fi


# extract and link only if explicitly requested
if [ "$COMMAND" != "install" ]; then
	echo "Download complete: $JDK_TAR_GZ"
	exit 0
fi


echo "Extract $JDK_TAR_GZ"
tar -v -zxf "$JDK_TAR_GZ"

# find java executable
JAVA_EXE=`find "$PWD" -name "java" -type f | head -n 1`

# link executable into /usr/local/bin/java
mkdir -p "/usr/local/bin"
ln -s -f "$JAVA_EXE" "/usr/local/bin/java"

# link java home to /usr/local/java
JAVA_BIN=`dirname $JAVA_EXE`
JAVA_HOME=`dirname $JAVA_BIN`
ln -s -f "$JAVA_HOME" "/usr/local/java"

# test
echo "Execute $JAVA_EXE -XshowSettings -version"
"$JAVA_EXE" -XshowSettings -version
Many thanks.
User avatar
rednoah
The Source
Posts: 24312
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem installing Java Installer on Synology NAS

Post by rednoah »

https://get.filebot.net/syno/ is our package repository. You seem to have added a different package from a different package source that uses the same name. You seem to have installed software for the https://spk7.imnks.com/ package repository, which seems to have java-installer packages that are based on our official package but with modifications for users in China.



UPDATE
:arrow: [Synology] Java Installer fails to update: ghproxy.cfd DNS error (curl: Could not resolve host)
:idea: Please read the FAQ and How to Request Help.
nickleigh78
Posts: 7
Joined: 27 Aug 2019, 08:24

Re: Problem installing Java Installer on Synology NAS

Post by nickleigh78 »

As highlighted in [Synology] Java Installer fails to update: ghproxy.cfd DNS error (curl: Could not resolve host), once i removed the "https://synopackage.com/repository/spk/All" package source, i was finally able to reinstall the offical rednoah Java Installer package on DSM for a user outside China.

viewtopic.php?t=14919
Linus
Posts: 4
Joined: 01 Dec 2025, 20:26

Re: Problem installing Java Installer on Synology NAS

Post by Linus »

I'm sorry to inform you that I am also experiencing the problem mentioned below.
nickleigh78 wrote: 20 Nov 2025, 23:27 Currently having an issue with the Synology Java installer (23) on Synology DSM 7.2.2-72806 Update 5
DSM update was automatically installed overnight
Checksum mismatch and curl resolve host error in the install-java.log

Please could you provide any advice to fix the error.

Many thanks

Console Output: Select all

$ cat /volume1/@appstore/java-installer/install-java.log
cmp: EOF on /volume1/@appstore/java-installer/get-java.sh.asc which is empty
Fri Nov 21 09:01:08 AEST 2025: AUTO UPDATE
gpgv: Signature made Mon Feb  3 17:58:27 2025 AEST
gpgv:                using RSA key 27B74F30D08404D1CCA0AF848A17D093B565EAD7
gpgv: Good signature from "imnks.com <[email protected]>"
Download https://ghproxy.cn/https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.2%2B7/OpenJDK23U-jdk_x64_linux_hotspot_23.0.2_7.tar.gz
curl: (6) Could not resolve host: ghproxy.cfd
curl: (6) Could not resolve host: ghproxy.cfd
curl: (6) Could not resolve host: ghproxy.cfd
curl: (6) Could not resolve host: ghproxy.cfd
curl: (6) Could not resolve host: ghproxy.cfd
curl: (6) Could not resolve host: ghproxy.cfd
OpenJDK23U-jdk_x64_linux_hotspot_23.0.2_7.tar.gz: No such file or directory
Expected SHA256 checksum: 870ac8c05c6fe563e7a3878a47d0234b83c050e83651d2c47e8b822ec74512dd
Actual SHA256 checksum:
ERROR: SHA256 checksum mismatch
removed 'bin/java'
removed directory 'bin'
rm: cannot remove 'include': No such file or directory
rm: cannot remove 'jmods': No such file or directory
rm: cannot remove 'lib': No such file or directory
rm: cannot remove 'conf': No such file or directory
rm: cannot remove 'legal': No such file or directory
rm: cannot remove 'man': No such file or directory
tar (child): *.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Last edited by Linus on 01 Dec 2025, 20:40, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 24312
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem installing Java Installer on Synology NAS

Post by rednoah »

This problem has been solved. The root cause is adding a 3rd party package repository that uses the same package ID as the official packages from our official repository.

Please read the posts above for details.
:idea: Please read the FAQ and How to Request Help.
Linus
Posts: 4
Joined: 01 Dec 2025, 20:26

Re: Problem installing Java Installer on Synology NAS

Post by Linus »

rednoah wrote: 02 Dec 2025, 03:00 This problem has been solved. The root cause is adding a 3rd party package repository that uses the same package ID as the official packages from our official repository.

Please read the posts above for details.
I don't have this package repository installed and never had.
User avatar
rednoah
The Source
Posts: 24312
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem installing Java Installer on Synology NAS

Post by rednoah »

Linus wrote: 02 Dec 2025, 13:32 I don't have this package repository installed and never had.
Then the issue you have is not the issue discussed on this thread.

:?: What does the log say?

:idea: If the log says Could not resolve host: ghproxy.cfd then you most assuredly are not using our java-installer package. If the log says something else, then it's a different issue.
:idea: Please read the FAQ and How to Request Help.
Linus
Posts: 4
Joined: 01 Dec 2025, 20:26

Re: Problem installing Java Installer on Synology NAS

Post by Linus »

The log says:

Console Output: Select all

cmp: EOF on /volume1/@appstore/java-installer/get-java.sh.asc
Wed Dec  3 14:13:38 CET 2025: AUTO UPDATE
gpgv: Signature made Sun Nov  9 10:35:16 2025 CET
gpgv:                using RSA key B0976E51E5C047AD0FD051294E402EBF7C3C6A71
gpgv:                issuer "[email protected]"
gpgv: Good signature from "Reinhard Pointner <[email protected]>"
Download https://download.bell-sw.com/java/21.0.9+11/bellsoft-jdk21.0.9+11-linux-arm32-vfp-hflt.tar.gz
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
bellsoft-jdk21.0.9+11-linux-arm32-vfp-hflt.tar.gz: No such file or directory
Expected SHA256 checksum: ae2d3e750496da6d5fd467c5c7e0d2146bdcdd8ad9aa902a09fbdfc3cb542e86
Actual SHA256 checksum: 
ERROR: SHA256 checksum mismatch
removed 'bin/java'
removed directory 'bin'
rm: cannot remove 'include': No such file or directory
rm: cannot remove 'jmods': No such file or directory
rm: cannot remove 'lib': No such file or directory
rm: cannot remove 'conf': No such file or directory
rm: cannot remove 'legal': No such file or directory
rm: cannot remove 'man': No such file or directory
tar (child): *.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
User avatar
rednoah
The Source
Posts: 24312
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem installing Java Installer on Synology NAS

Post by rednoah »

:idea: The URL itself works:

Code: Select all

https://download.bell-sw.com/java/21.0.9+11/bellsoft-jdk21.0.9+11-linux-arm32-vfp-hflt.tar.gz

:idea: But you're getting an SSL error:

Console Output: Select all

curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

:arrow: Unfortunately, since I cannot reproduce the issue, you'll have to figure it out from there yourself from your end. The gist is simply that your NAS fails to download that file. If you SSH into the NAS and try to do it manually step-by-step, you might be able to figure something out, some technical expertise required though.


:idea: SSL certificate problem: unable to get local issuer certificate might indicate that your NAS is very out-of-date and doesn't have the current common root certificates required for HTTPS connections. That's just a random guess though. Could be something else entirely.
:idea: Please read the FAQ and How to Request Help.
Linus
Posts: 4
Joined: 01 Dec 2025, 20:26

Re: Problem installing Java Installer on Synology NAS

Post by Linus »

Thank you very much!

What makes me wonder is that I didn’t have any problem installing the Java installer at first. But then, all of a sudden, it stopped working, and the package showed “Repair.” Now I can’t reinstall it anymore.
User avatar
rednoah
The Source
Posts: 24312
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem installing Java Installer on Synology NAS

Post by rednoah »

SSL certificates expire and get renewed all the time. It's very possible for something to work last year / month / week and not work this year / month / week.
:idea: Please read the FAQ and How to Request Help.
Post Reply