There is a lot of good Java software, but it’s difficult to get Java running on a NAS. I decided to do something about that, mainly to pave the way for a Serviio package that didn’t require a huge guide to install. In compliance with the Oracle EULA the Java binaries cannot be redistributed, so this package looks for the downloaded .tar.gz archive in the public shared folder on the NAS. The end user is required to register with Oracle to get the file, as you can see from the description below. I also added locale support to the underlying Linux since Java requires this for UTF-8 support when reading from the filesystem (DSM 4.3 later included this). Timezone support is also configured.
This package installs Java SE Embedded which is purposefully designed to run on low specification headless hardware. It should be noted that Synology Java Manager (only available on Intel products) is the full Java Runtime Environment, and consequently uses more RAM. By default you should use Java 8, unless the application you want to run specifically requires Java 7.
Please note that Oracle ceased maintaining Java 6 in 2012, so it should be considered a serious security vulnerability. The Java 6 package has been withdrawn from the package repository for this reason. If you need it to run a particular piece of software you may download it here for manual installation. Please also note that Oracle retired support for PowerPC CPUs following Java 8 Update 6, so the PowerPC package remains at that version.

Instructions
- In Synology DSM’s Package Center, click Settings and add my package repository:

- The repository will push its certificate automatically to the NAS, which is used to validate package integrity. Set the Trust Level to Synology Inc. and trusted publishers:

- Now browse the Community section in Package Center to install a Java SE Embedded package:

The repository only displays packages which are compatible with your specific model of NAS. If you don’t see Java Embedded in the list, then either your NAS model or your DSM version are not supported at this time. - If you have a multi-bay NAS, use the Shared Folder control panel to create a shared folder called public (it must be all lower case). On single bay models this is created by default. Assign it with Read/Write privileges for everyone.
- Register with Oracle and download the appropriate version of Java SE Embedded for your CPU architecture and save in the public shared folder on your NAS. Note that to get any version of Java older than the current one you will need to follow the Oracle Java SE Embedded Downloads Archive link on that page. If in doubt, attempt to install the package first, and the error message will tell you which specific download version is required.
- If you have trouble getting the Java archive recognised, try downloading it with a different web browser. Some browsers try to help by uncompressing the file, or renaming it without warning. I have tried to code around most of these behaviours. Use Firefox if all else fails.
Package scripts
For information, here are the package scripts so you can see what it’s going to do. You can get more information about how packages work by reading the Synology 3rd Party Developer Guide.
installer.sh
#!/bin/sh
#--------JAVA installer script
#--------package maintained at pcloadletter.co.uk
COMMENT="# Synology Java Package"
SYNO_CPU_ARCH="`uname -m`"
[ "`echo ${SYNO_CPU_ARCH} | cut -c1-7`" == "armv5te" ] && SYNO_CPU_ARCH="armv5tel"
#--------Synology switched Armada 370 systems from SoftFP to HardFP EABI for DSM 6.0
[ "${SYNOPKG_DSM_ARCH}" == "armada370" ] && [ ${SYNOPKG_DSM_VERSION_MAJOR} -gt 5 ] && SYNO_CPU_ARCH="armv7l-hflt"
[ "${SYNOPKG_DSM_ARCH}" == "armada375" ] && SYNO_CPU_ARCH="armv7l-hflt"
[ "${SYNOPKG_DSM_ARCH}" == "armada38x" ] && SYNO_CPU_ARCH="armv7l-hflt"
[ "${SYNOPKG_DSM_ARCH}" == "comcerto2k" ] && SYNO_CPU_ARCH="armv7l-hflt"
[ "${SYNOPKG_DSM_ARCH}" == "alpine" ] && SYNO_CPU_ARCH="armv7l-hflt"
[ "${SYNOPKG_DSM_ARCH}" == "alpine4k" ] && SYNO_CPU_ARCH="armv7l-hflt"
[ "${SYNOPKG_DSM_ARCH}" == "monaco" ] && SYNO_CPU_ARCH="armv7l-hflt"
[ "${SYNOPKG_DSM_ARCH}" == "x86_64" ] && [ "${WIZARD_JRE_EE}" == "true" ] && SYNO_CPU_ARCH="i686"
[ "${SYNOPKG_DSM_ARCH}" == "x86_64" ] && [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 6 ] && SYNO_CPU_ARCH="i686"
if [ "${SYNOPKG_PKGNAME}" == "java6" ]; then
DOWNLOAD_URL="http://tinyurl.com/javaembedarchive"
EXTRACTED_FOLDER="ejre1.6.0_38"
JCE_BINARY="jce_policy-6.zip"
JCE_URL="http://tinyurl.com/java-jce6"
JCE_FOLDER="jce"
if [ "`echo ${SYNO_CPU_ARCH} | cut -c1-7`" == "armv5te" ]; then
JAVA_BINARY="ejre-1_6_0_38-fcs-b05-linux-arm-sflt-eabi-headless-13_nov_2012.tar.gz"
JAVA_BUILD="ARMv5 Linux - Headless EABI"
elif [ "${SYNO_CPU_ARCH}" == "armv7l" ]; then
JAVA_BINARY="ejre-1_6_0_38-fcs-b05-linux-arm-vfp-eabi-headless-13_nov_2012.tar.gz"
JAVA_BUILD="ARMv6/7 Linux - Headless EABI, VFP, SoftFP ABI, Little Endian"
elif [ "${SYNO_CPU_ARCH}" == "i686" ]; then
JAVA_BINARY="ejre-1_6_0_38-fcs-b05-linux-i586-headless-13_nov_2012.tar.gz"
JAVA_BUILD="x86 Linux Small Footprint - Headless"
elif [ "${SYNO_CPU_ARCH}" == "x86_64" ]; then
JAVA_BINARY="ejre-1_6_0_38-fcs-b05-linux-i586-headless-13_nov_2012.tar.gz"
JAVA_BUILD="x86 Linux Small Footprint - Headless"
elif [ "${SYNO_CPU_ARCH}" == "ppc" ]; then
JAVA_BINARY="ejre-1_6_0_38-fcs-b05-linux-ppc-e500v2-headless-13_nov_2012.tar.gz"
JAVA_BUILD="Power Architecture Linux - Headless - e500v2 core"
fi
elif [ "${SYNOPKG_PKGNAME}" == "java7" ]; then
DOWNLOAD_URL="http://tinyurl.com/javaembed"
EXTRACTED_FOLDER="ejre1.7.0_75"
JCE_BINARY="UnlimitedJCEPolicyJDK7.zip"
JCE_URL="http://tinyurl.com/java-jce7"
JCE_FOLDER="UnlimitedJCEPolicy"
if [ "${SYNO_CPU_ARCH}" == "armv5tel" ]; then
JAVA_BINARY="ejre-7u75-fcs-b13-linux-arm-sflt-headless-18_dec_2014.tar.gz"
JAVA_BUILD="ARMv5 Linux - Headless EABI, SoftFP ABI, Little Endian"
elif [ "${SYNO_CPU_ARCH}" == "armv7l" ]; then
JAVA_BINARY="ejre-7u75-fcs-b13-linux-arm-vfp-sflt-client_headless-18_dec_2014.tar.gz"
JAVA_BUILD="ARMv6/7 Linux - Headless - Client Compiler EABI, VFP, SoftFP ABI, Little Endian"
elif [ "${SYNO_CPU_ARCH}" == "armv7l-hflt" ]; then
JAVA_BINARY="ejre-7u75-fcs-b13-linux-arm-vfp-hflt-client_headless-18_dec_2014.tar.gz"
JAVA_BUILD="ARMv6/7 Linux - Headless - Client Compiler EABI, VFP, HardFP ABI, Little Endian"
elif [ "${SYNO_CPU_ARCH}" == "i686" ]; then
JAVA_BINARY="ejre-7u75-fcs-b13-linux-i586-headless-18_dec_2014.tar.gz"
JAVA_BUILD="x86 Linux Small Footprint - Headless"
elif [ "${SYNO_CPU_ARCH}" == "x86_64" ]; then
JAVA_BINARY="ejre-7u75-fcs-b13-linux-i586-headless-18_dec_2014.tar.gz"
JAVA_BUILD="x86 Linux Small Footprint - Headless"
elif [ "${SYNO_CPU_ARCH}" == "ppc" ]; then
JAVA_BINARY="ejre-7u75-fcs-b13-linux-ppc-e500v2-headless-18_dec_2014.tar.gz"
JAVA_BUILD="Power Architecture Linux - Headless - e500v2 with double-precision SPE Floating Point Unit"
fi
elif [ "${SYNOPKG_PKGNAME}" == "java8" ]; then
DOWNLOAD_URL="http://tinyurl.com/javaembed"
EXTRACTED_FOLDER="ejdk1.8.0_211"
JCE_BINARY="jce_policy-8.zip"
JCE_URL="http://tinyurl.com/java-jce8"
JCE_FOLDER="UnlimitedJCEPolicyJDK8"
if [ "${SYNO_CPU_ARCH}" == "armv5tel" ]; then
JAVA_BINARY="ejdk-8u211-linux-arm-sflt.tar.gz"
JAVA_BUILD="ARMv5/ARMv6/ARMv7 Linux - SoftFP ABI, Little Endian 2"
elif [ "${SYNO_CPU_ARCH}" == "armv7l" ]; then
JAVA_BINARY="ejdk-8u211-linux-arm-sflt.tar.gz"
JAVA_BUILD="ARMv5/ARMv6/ARMv7 Linux - SoftFP ABI, Little Endian 2"
elif [ "${SYNO_CPU_ARCH}" == "armv7l-hflt" ]; then
JAVA_BINARY="ejdk-8u211-linux-armv6-vfp-hflt.tar.gz"
JAVA_BUILD="ARMv6/ARMv7 Linux - VFP, HardFP ABI, Little Endian 1"
elif [ "${SYNO_CPU_ARCH}" == "aarch64" ]; then
JAVA_BINARY="jdk-8u211-linux-arm64-vfp-hflt.tar.gz"
JAVA_BUILD="Linux ARM 64 Hard Float ABI"
DOWNLOAD_URL="http://tinyurl.com/java8arm64"
EXTRACTED_FOLDER="jdk1.8.0_211"
elif [ "${SYNO_CPU_ARCH}" == "i686" ]; then
JAVA_BINARY="ejdk-8u211-linux-i586.tar.gz"
JAVA_BUILD="x86 Linux Small Footprint - Headless"
elif [ "${SYNO_CPU_ARCH}" == "x86_64" ]; then
JAVA_BINARY="jre-8u211-linux-x64.tar.gz"
JAVA_BUILD="Linux x64"
EXTRACTED_FOLDER="jre1.8.0_211"
DOWNLOAD_URL="http://tinyurl.com/java8x64"
elif [ "${SYNO_CPU_ARCH}" == "ppc" ]; then
#Oracle have discontinued Java 8 for PowerPC after update 6
JAVA_BINARY="ejdk-8u6-fcs-b23-linux-ppc-e500v2-12_jun_2014.tar.gz"
JAVA_BUILD="Power Architecture Linux - Headless - e500v2 with double-precision SPE Floating Point Unit"
EXTRACTED_FOLDER="ejdk1.8.0_06"
fi
fi
JAVA_BINARY=`echo ${JAVA_BINARY} | cut -f1 -d'.'`
PUBLIC_FOLDER="`synoshare --get public | sed -r "/Path/!d;s/^.*\[(.*)\].*$/\1/"`"
TEMP_FOLDER="`find / -maxdepth 2 -path '/volume?/@tmp' | head -n 1`"
NATIVE_BINS_URL="http://packages.pcloadletter.co.uk/downloads/java-native-${SYNO_CPU_ARCH}.tar.xz"
NATIVE_BINS_FILE="`echo ${NATIVE_BINS_URL} | sed -r "s%^.*/(.*)%\1%"`"
#DSM versions older than 4.3 need locale support adding, don't download unless needed
[ ! -e /usr/bin/locale ] && INSTALL_FILES="${NATIVE_BINS_URL}"
source /etc/profile
preinst ()
{
synoshare -get public > /dev/null || (
echo "A shared folder called 'public' could not be found - note this name is case-sensitive. " >> $SYNOPKG_TEMP_LOGFILE
echo "Please create this using the Shared Folder DSM Control Panel and try again." >> $SYNOPKG_TEMP_LOGFILE
exit 1
)
JAVA_BINARY_FOUND=
if [ -n "${JAVA_HOME}" ]; then
echo "It seems from /etc/profile that a Java Runtime is already installed at ${JAVA_HOME}. Uninstall it and try again." >> $SYNOPKG_TEMP_LOGFILE
exit 1
fi
[ -f ${PUBLIC_FOLDER}/${JAVA_BINARY}.tar.gz ] && JAVA_BINARY_FOUND=true
[ -f ${PUBLIC_FOLDER}/${JAVA_BINARY}.tar ] && JAVA_BINARY_FOUND=true
[ -f ${PUBLIC_FOLDER}/${JAVA_BINARY}.tar.tar ] && JAVA_BINARY_FOUND=true
[ -f ${PUBLIC_FOLDER}/${JAVA_BINARY}.gz ] && JAVA_BINARY_FOUND=true
if [ -z ${JAVA_BINARY_FOUND} ]; then
echo "Java binary bundle not found. " >> $SYNOPKG_TEMP_LOGFILE
echo "I was expecting the file ${PUBLIC_FOLDER}/${JAVA_BINARY}.tar.gz. " >> $SYNOPKG_TEMP_LOGFILE
echo "Please agree to the Oracle licence at ${DOWNLOAD_URL}, then download the '${JAVA_BUILD}' package" >> $SYNOPKG_TEMP_LOGFILE
echo "and place it in the 'public' shared folder on your NAS. This download cannot be automated even if " >> $SYNOPKG_TEMP_LOGFILE
echo "displaying a package EULA could potentially cover the legal aspect, because files hosted on Oracle's " >> $SYNOPKG_TEMP_LOGFILE
echo "server are protected by a session cookie requiring a JavaScript enabled browser." >> $SYNOPKG_TEMP_LOGFILE
exit 1
fi
if [ "${WIZARD_JCE_UL}" == "true" ]; then
if [ ! -f ${PUBLIC_FOLDER}/${JCE_BINARY} ]; then
echo "JCE Unlimited Strength binary bundle not found. " >> $SYNOPKG_TEMP_LOGFILE
echo "I was expecting the file ${PUBLIC_FOLDER}/${JCE_BINARY} " >> $SYNOPKG_TEMP_LOGFILE
echo "Please agree to the Oracle licence at ${JCE_URL}, then download the Unlimited Strength Jurisdiction Policy Files zip file " >> $SYNOPKG_TEMP_LOGFILE
echo "and place it in the 'public' shared folder on your NAS. " >> $SYNOPKG_TEMP_LOGFILE
exit 1
fi
fi
cd ${TEMP_FOLDER}
for WGET_URL in ${INSTALL_FILES}
do
WGET_FILENAME="`echo ${WGET_URL} | sed -r "s%^.*/(.*)%\1%"`"
[ -f ${TEMP_FOLDER}/${WGET_FILENAME} ] && rm ${TEMP_FOLDER}/${WGET_FILENAME}
wget ${WGET_URL}
if [[ $? != 0 ]]; then
if [ -d ${PUBLIC_FOLDER} ] && [ -f ${PUBLIC_FOLDER}/${WGET_FILENAME} ]; then
cp ${PUBLIC_FOLDER}/${WGET_FILENAME} ${TEMP_FOLDER}
else
echo "There was a problem downloading ${WGET_FILENAME} from the official download link, " >> $SYNOPKG_TEMP_LOGFILE
echo "which was \"${WGET_URL}\" " >> $SYNOPKG_TEMP_LOGFILE
echo "Alternatively, you may download this file manually and place it in the 'public' shared folder. " >> $SYNOPKG_TEMP_LOGFILE
exit 1
fi
fi
done
exit 0
}
postinst ()
{
WORKING_DIR=`pwd`
#ldd tool is very useful but not included in DSM
if [ ! -e /usr/local/bin/ldd ]; then
mkdir -p /usr/local/bin
cp ${SYNOPKG_PKGDEST}/tools/ldd-${SYNO_CPU_ARCH} /usr/local/bin/ldd
fi
#extract native binaries if needed
if [ -e ${TEMP_FOLDER}/${NATIVE_BINS_FILE} ]; then
cd ${SYNOPKG_PKGDEST}
#older DSM tar uses different command line switch for xz archives
tar xJf ${TEMP_FOLDER}/${NATIVE_BINS_FILE} || tar xaf ${TEMP_FOLDER}/${NATIVE_BINS_FILE}
rm ${TEMP_FOLDER}/${NATIVE_BINS_FILE}
fi
#extract Java (Web browsers love to interfere with .tar.gz files)
cd ${PUBLIC_FOLDER}
if [ -f ${JAVA_BINARY}.tar.gz ]; then
#Firefox seems to be the only browser that leaves it alone
tar xzf ${JAVA_BINARY}.tar.gz
elif [ -f ${JAVA_BINARY}.gz ]; then
#Chrome
tar xzf ${JAVA_BINARY}.gz
elif [ -f ${JAVA_BINARY}.tar ]; then
#Safari
tar xf ${JAVA_BINARY}.tar
elif [ -f ${JAVA_BINARY}.tar.tar ]; then
#Internet Explorer
tar xzf ${JAVA_BINARY}.tar.tar
fi
#install Java
if [ "${EXTRACTED_FOLDER}" != "${EXTRACTED_FOLDER/jdk/}" ]; then
mv ${EXTRACTED_FOLDER} ${SYNOPKG_PKGDEST}
JRE_PATH="`find ${SYNOPKG_PKGDEST}/${EXTRACTED_FOLDER} -name jre`"
else
mv ${EXTRACTED_FOLDER} ${SYNOPKG_PKGDEST}/jre
JRE_PATH="${SYNOPKG_PKGDEST}/jre"
fi
#install unlimited crypto policy files if requested
if [ "${WIZARD_JCE_UL}" == "true" ]; then
if [ -e /usr/bin/7z ]; then
7z x ${JCE_BINARY} > /dev/null 2>&1
else
unzip ${JCE_BINARY}
fi
mv ${JCE_FOLDER}/* ${JRE_PATH}/lib/security
rmdir ${JCE_FOLDER}
fi
#change owner of folder tree
chown -R root:root ${SYNOPKG_PKGDEST}
echo "NOTE - This package does *not* start and stop like other packages. " >> $SYNOPKG_TEMP_LOGFILE
echo "Java is correctly installed if you can see the runtime and HotSpot version numbers, " >> $SYNOPKG_TEMP_LOGFILE
echo "and locale information in the package Log tab." >> $SYNOPKG_TEMP_LOGFILE
exit 0
}
preuninst ()
{
exit 0
}
postuninst ()
{
#clean up profile mods
sed -i "/${COMMENT}/d" /etc/profile
sed -i "/${COMMENT}/d" /root/.profile
#leave locale support in place on older DSM versions - too risky to delete system binaries
exit 0
}
start-stop-status.sh
#!/bin/sh
JRE_PATH="`find /var/packages/${SYNOPKG_PKGNAME}/target/ -name jre`"
COMMENT="# Synology Java Package"
#set the current timezone for Java so that log timestamps are accurate, modern timezone names so DST works
SYNO_TZ=`cat /etc/synoinfo.conf | grep timezone | cut -f2 -d'"'`
#fix for DST time in DSM 5.2 thanks to MinimServer Syno package author
[ -e /usr/share/zoneinfo/Timezone/synotztable.json ] \
&& SYNO_TZ=`jq ".${SYNO_TZ} | .nameInTZDB" /usr/share/zoneinfo/Timezone/synotztable.json | sed -e "s/\"//g"` \
|| SYNO_TZ=`grep "^${SYNO_TZ}" /usr/share/zoneinfo/Timezone/tzname | sed -e "s/^.*= //"`
EnvCheck ()
#updates to DSM will reset these changes so check them each startup
{
#/etc/profile should contain 5 lines added by this package tagged with trailing comments
COUNT=`grep -c "$COMMENT$" /etc/profile`
if [ $COUNT != 5 ]; then
#remove any existing mods
sed -i "/${COMMENT}/d" /etc/profile
#add required environment variables
echo "PATH=\$PATH:${JRE_PATH}/bin ${COMMENT}" >> /etc/profile
echo "JAVA_HOME=${JRE_PATH} ${COMMENT}" >> /etc/profile
echo "CLASSPATH=.:${JRE_PATH}/lib ${COMMENT}" >> /etc/profile
echo "LANG=en_US.utf8 ${COMMENT}" >> /etc/profile
echo "export CLASSPATH JAVA_HOME LANG PATH ${COMMENT}" >> /etc/profile
fi
#/root/.profile should contain 3 lines added by this package tagged with trailing comments
COUNT=`grep -c "$COMMENT$" /root/.profile`
if [ $COUNT != 3 ]; then
#remove any existing mods
sed -i "/${COMMENT}/d" /root/.profile
#add required environment variables
echo "PATH=\$PATH:${JRE_PATH}/bin ${COMMENT}" >> /root/.profile
echo "TZ='${SYNO_TZ}' ${COMMENT}" >> /root/.profile
echo "export PATH TZ ${COMMENT}" >> /root/.profile
fi
#timezone needs setting each startup in case system value has changed
sed -i "s%^TZ=.* ${COMMENT}%TZ='${SYNO_TZ}' ${COMMENT}%" /root/.profile
#DSM versions older than 4.3 need locale support adding
if [ ! -e /usr/bin/locale ]; then
#build missing locale with UTF-8 support (don't think it matters which language)
cp ${SYNOPKG_PKGDEST}/bin/* /usr/bin
cp -R ${SYNOPKG_PKGDEST}/share/i18n /usr/share
if [ ! -d /usr/lib/locale ]; then
mkdir /usr/lib/locale
fi
localedef -c -f UTF-8 -i en_US en_US.utf8
fi
#DSM versions up to 5.1 are missing the zoneinfo timezone definitions which causes inaccurate log timestamps
#thanks to CoolRaoul here: http://forum.synology.com/enu/viewtopic.php?f=19&t=69232#p310553
#to revert, just remove everything apart from 'Timezone' 'zone.tab' from /usr/share/zoneinfo
if [ ! -e /usr/share/zoneinfo/Europe/London ]; then
cp -R ${SYNOPKG_PKGDEST}/zoneinfo/* /usr/share/zoneinfo/
fi
}
case $1 in
start)
EnvCheck
source /etc/profile
source /root/.profile
#evidence of whether Java can start successfully is written to the package log
java -version > ${SYNOPKG_PKGDEST}/output.log 2>&1
echo >> ${SYNOPKG_PKGDEST}/output.log
echo System installed locales: >> ${SYNOPKG_PKGDEST}/output.log
locale -a >> ${SYNOPKG_PKGDEST}/output.log
echo >> ${SYNOPKG_PKGDEST}/output.log
echo JAVA_HOME=$JAVA_HOME >> ${SYNOPKG_PKGDEST}/output.log
echo TZ=$TZ >> ${SYNOPKG_PKGDEST}/output.log
exit 0
;;
stop)
exit 0
;;
status)
source /etc/profile
source /root/.profile
if [ -e "${JAVA_HOME}/bin/java" ]; then
exit 0
else
exit 1
fi
;;
log)
echo "${SYNOPKG_PKGDEST}/output.log"
exit 0
;;
esac
install_uifile
[
{
"step_title": "Java Runtime Environment Selection",
"items": [
{
"type": "singleselect",
"desc": "Please select the Java version to install:",
"subitems": [
{
"key": "WIZARD_JRE_EE",
"desc": "Java SE Embedded 8 (smaller memory footprint, 32bit)",
"defaultValue": true
},
{
"key": "WIZARD_JRE_SE",
"desc": "Java SE 8 (64bit)",
"defaultValue": false
}
]
}
]
},
{
"step_title": "Java Cryptography Strength Selection",
"items": [
{
"type": "singleselect",
"desc": "Please select Java Cryptographic Extension policy:",
"subitems": [
{
"key": "WIZARD_JCE_STD",
"desc": "Default Strong JCE policy - limited to AES-128 encryption",
"defaultValue": true
},
{
"key": "WIZARD_JCE_UL",
"desc": "Unlimited Strength JCE policy - not permitted in some jurisdictions, see Oracle documentation",
"defaultValue": false
}
]
}
]
}
]
Changelog:
- 0050 17/Apr/19 – Updated to Java 8u211, added support for DS119j
- 0049 11/Apr/19 – Updated to Java 8u201, fixed issue where x86_64 CPUs would ignore user selection and always install 64bit Java SE
- 0048 22/Aug/18 – Updated to Java 8u181, added option to select 64bit full Java SE for x86_64 CPUs
- 0047 14/May/18 – Updated to Java 8u171
- 0046 20/Feb/18 – Updated to Java 8u161, experimental aarch64 support
- 0045 30/Oct/17 – Updated to Java 8u151, added support for new CPUs in x17 and x18 models
- 0044 02/Aug/17 – Updated to Java 8u144
- 0043 21/Jan/17 – Updated to Java 8u121
- 0042 07/Jan/17 – Updated to Java 8u111, fixed Armada 370/XP systems running DSM 6.0 which had switched from soft to hard float ABI
- 0041 25/Jul/16 – Added support for unlimited strength cryptography (default is strong)
- 0040 20/Jul/16 – Updated to Java 8u101
- 0039 26/Apr/16 – Updated to Java 8u91
- 0038 24/Mar/16 – Updated to Java 8u77
- 0037 07/Feb/16 – Updated to Java 8u73
- 0036 26/Jan/16 – Updated to Java 8u71
- 0035 14/Dec/15 – Updated to Java 8u65, added support for models DS716+ and DS216play
- 0034 19/Aug/15 – Fixed timezone DST issue with DSM 5.2, added support for DS215+
- 0033 07/Aug/15 – Updated to Java 8u51, PowerPC build remains at 8u6
- 0032 13/Jul/15 – Fixed timezone issue with DSM 5.2, updated main blog post documentation
- 0031 25/Jan/15 – Fixed issue with version 0030 for systems with more than one volume
- 0030 21/Jan/15 – Improved temp folder detection, updated to Java 7u75 and Java 8u33 (Oracle did not publish a version for PowerPC)
- 0029 25/Dec/14 – DSM timezone zone.tab file is no longer overwritten, which had been prompting a malware alert in DSM 5.1 Security Advisor
- 0028 20/Oct/14 – Updated to Java 7u71, added missing zoneinfo timezone definitions to fix inaccurate timestamps for non-GMT timezones (checked every startup), switched native binary archives from .tgz to .tar.xz format to reduce size
- 0027 18/Oct/14 – Updated Java 8 to 8u6, added support for Mindspeed Comcerto 2000 CPU in DS414j for Java 7 and Java 8
- 0026 24/Jun/14 – DSM updates will no longer break Java
- 0025 31/May/14 – Updated to Java 7u60
- 0024 31/May/14 – Updated to Java 7u55
- 0023 27/May/14 – Added Java 8 support
- 0022 30/Jan/14 – Updated to Java 7u51
- 0021 15/Nov/13 – Locale support is no longer downloaded and added to DSM 4.3 or newer since it’s already present
- 0020 30/Oct/13 – Added support for Intel Atom Evansport and Armada XP CPUs in new DSx14 products, removed Early Access JDK 8 support since it did not run on the Armada SoCs
- 0019 17/Oct/13 – Updated to Java 7u45
- 0018 11/Oct/13 – Updated to Java 7u40, and JDK8 Early Access b106
- 0017 05/Jun/13 – For Armada370 CPU changed from ARMv7 Server JVM to Client JVM since the Server one turned out to be unstable. Added support for Early Access JDK 8 for Armada 370.
- 0016 21/May/13 – Added Armada370 CPU support (DS213j)
- 0015 18/Apr/13 – Updated to Java 7u21, Java 6 Embedded seems to be no longer maintained by Oracle
- 0014 13/Feb/13 – Fixed metadata for DSM 4.2 Package Center
- 013 13/Dec/12 – Updated to Java 6u38 and Java 7u10
- 012 10/Dec/12 – Installer script fetches native binaries separately to reduce bandwidth on repo hosting
- 011 Added support for Freescale QorIQ PowerPC CPUs used in some Synology x13 series products, PowerQUICC PowerPC processors in previous Synology generations with older glibc versions are not supported
- 010 updated to Java 6u34 and Java 7u6
- 009 corrected timezone bug for Atlantic and Pacific timezones which may have caused error messages when in fact the package had installed correctly
- 008 unified the build scripts
- 007 included the locale binaries to simplify installation, fixed environment variables for root user (inc. timezone with DST support), displayed Java version information and env vars in Log tab, incremented Java to latest versions 6u32 and 7u4, fixed detection of renamed .tar.gz archives downloaded by Google Chrome
- 006 fixed path issue for root user on non-bootstrapped systems, updated info link to refer back to this page, and improved description text
- 005 incremented JRE versions to match new releases from Oracle
- 004 forced check for existence of ‘public’ shared folder
- 003 fixed a stupid typo that stopped 002 from working :)
- 002 rewrote scripts to be easier to maintain, and to allow for web browsers that untar or rename the Java and toolchain binary bundles as they’re saved
- 001 23/Aug/11 – fixed package repo support, defined as a non-runnable service, prevented more than one JRE being installed, saved files into actual package folder rather than @appstore/java now that package names can be separate from Package Center display names
- v3 initial spk release (I think!)

Right solved that and now have a healthy error message.
Java is not installed or properly configured, JAVA_HOME is not defined, Download and install the java synology package from http://wp.me/pXshC-z5
Download the package again from Oracle. This helped for me.
Trying to get this running on a Synology 212j with DSM 5.1. My public folder is empty, I’ve added the repo, and when I attempt to install Java SE Embedded 7 I just get the error message “Failed to install “Java SE Embedded 7.” But no other info like which package I should upload to the public folder. I’ve tried all the current ARM headless packages and nothing seems to be working. Any thoughts? Is it because of DSM 5.1?
Solved: Did not have permissions to install packages from “Any Publisher.” Install worked.
The CrashPlan and Java packages are now signed by Synology with my key, and my repo is currently pushing this key (see it in Certificates tab of Package Center Settings). So once all my packages have been signed I advise you set the trust level to “Synology Inc. and Trusted Publishers”.
Can’t reply on the answer of patters belwu, but you should mention this in the description. It’s kind of obvious that you need to allow the installer to actually install, but I didn’t know this setting existed and therefor lost an hour trying to figure out why it didn’t work. Or perhaps improve the error message ?
hi Patters
so pb starting to try the install of java 6 for a Ds415+ (intel atom)…
1) using DSM 5.1-5022 Update 2
2) activation of “service d’accueil utisisateur” in user menu – advanced (should be the user home service)
3) creation of public folder (admin user has all access)
4) download of jre 6 for intel, name same as in your script ejre-1_6_0_38-fcs-b05-linux-i586-headless-13_nov_2012.tar.gz
5) adding your url for custom packets downloads
6) click on java6 icon for install
it recognize the package, but when i click apply, i have the error: “echec de l’installation de java se embedded 6”
Do you have an idea or am I doing wrong somewhere?
thank’s!
ok consider i solved my java installation pb :)
now facing a pb of error loading serviio console: error
i put my nas ip into the vmoptions file, could see the homepage by hitting the mediabrowser directly on the nas
trying the console version 1.4.1.2 instead last one 1.5
edit during post reply: ok with 1.4.1.2 :)
so consider forget me!
regards
Pingback: JIRA Installation on Synolgy NAS – Part 1 – Introduction | Evan Laske
Hello Patters,
Thank you for this superpackage, it saves my life on a daily basis ! Just one question: do you advise to go to java 8 instead of 7, appart from the security point of view, is java 8 less hungry in terms of memory ?
Hi,
I’m having problems installing the Java 8 version of the package.
I can’t seem to find the right oracle download. I’ve tried several and keep getting told that the file format is invalid when I try to install the package.
Also I was wondering if it’s possible to install Java 8 and still have Java 7 installed via the Synology Java Manager, since I think some other packages (Crashplan for example) don’t like Java 8. I’m trying to run both Crashplan and filebot.
Hi – I am attempting to install on a DS415play running 5.01. I download and put into the public directory ejre-7u75-fcs-b13-linux-i586-headless-18_dec_2014.tar.gz but it is not recognized. I’ve followed the instuctions to the letter – where else might I look. Its the same for a JRE6 or 7 installation. Thanx — Al
Thnx for putting this up, I used it to install a minecraft server for my nephew. One question though: How can I start Java8 from the taskmanager on the Synolgy NAS eg create a task to launch java and the server.jar
I get the next error during the installation in my dms cp. Files hosted on oracle’s server are protected by a session.. the is more text
pica :
Hi,
I am using DSM 4.2 on a Synology DS 209 II, but I am unable to see the Java packaghes when I add them to the package center. I would like to install them for a Minecraft server for my son. Can you give me advise?
Have you been able to solve this? Same problem here.
Hello,
thank you for your work.
Sadly i am not successful in installing Java.
I tried to install either Java SE Embedded 7 or 8 on my DS215j. After installation the protocol says “start-stop-status.sh: line 28: java: not found”
Installing further packages end in the error “Java_Home not defined”
Do you have any suggestion how to solve this problem?
Thanks a lot,
Ben
Hi there,
I read in your explanation that “I also added locale support to the underlying Linux since Java requires this for UTF-8 support when reading from the filesystem.”.
Could you be more specific on this ? (howto :-p )
I actually am struggling with a crashplan install on a freeNas. Crashplan works but it has problem with non POSIX character sets (it actually ignores accentuated filenames). After some long research i believe the problem comes from the java itself (running on some linux compatibility layer) and stumbled on this post.
For the moment the java version used is linux-sun-jre1.7.0
Tx !
You may be missing some files in the Linux that’s on your NAS. For Synology the instructions are described in this post, but they probably also apply to most Linux flavours:
http://www.chainsawonatireswing.com/2012/01/08/set-up-the-synology-diskstation-ds411j-to-support-utf-8//?from=@
Hi there. Want to say thanks for your work on this package. Happily restoring from backup of a dead computer to my new NAS.
I am also trying to install on DSM 4.2 on a DS 509+. I added your repo, but only see craftbukkit, minecraft and openremote packages–no crashplan or java. Can you help me?
I updated to DSM 5.2 today and cannot get CrashPlan to run. Usually this is resolved by reinstalling Java 8 and the CrashPlan package. However, this time no luck. It appears that CrashPlan starts, but then attempts (unsuccessfully) to download and install an upgrade, then comes to a complete halt. Log screenshot (or link to image) is below. Any suggestions for resolving this?
Hi g8r87trp92
this article should help you sove your issue. It worked fine for me!
http://chrisnelson.ca/2015/05/12/fixing-crashplan-4-2-0-on-synology-after-dsm-5-2-update/
I’m having the same problem. My DS1513 updated to the latest DSM today and now Crash Plan won’t stay running. I’ve reinstall Java 7u75 and Crashplan but no luck. Any ideas?
So there is no way to get java 7+ on my DS 412+???? From your updates it seems as if I can have Java 8 on my DS412 intel processor. Or am I still limited because of my NAS
Hi Patters,
Since DSM5.2, I think there is a timezone TZ problem, applications running with Java are 2 hours late (Openhab, here in France)
It seems it comes from there in start-stop-status.sh :
SYNO_TZ=`grep “^${SYNO_TZ}” /usr/share/zoneinfo/Timezone/tzname | sed -e “s/^.*= //”`
tzname doesn’t exist anymore, replaced by tzlist.
Possible ?
Thanks for the good job,
Regards,
—
Veance
Thanks for the tip. I’ll add to the next version.
I had the same issue, with my times being ~6-7 hours off (can’t remember, I’m in CDT). The Java package install didn’t have any value in it’s log for TZ=
I manually made the change suggested above. When SSHed into my Synology, the “date” command shows the proper date & time. However, CrashPlan thinks the time is 1 hour earlier than the actual time (i.e. 8PM instead of 9PM). Any idea what I goofed up?
Hi, I have the same issue, Openhab is 2 hours behind. Any fix for this available so far?
I adjusted the start-stop-status.sh as described and replaced “tzname” by “tzlist” – anyway openhab is one hour behind, it seems that the daylight saving time is not considered, via osgi console I always get “GMT+1” for TZ String = “CET-1CEST,M3.5.0,M10.5.0/3″ (I also entered SYNO_TZ=”CET-1CEST,M3.5.0,M10.5.0/3” as fixed value in the start script – any idea what might cause Java not to calculate DST time correctly?
Thanks for the feedback – new version released with this fix implemented.
Tried to install version,6,7 and 8 but none worked on Synology DS413….got similar errors from all attempts.
“Failed to install “Java SE Embedded 8″.
Java binary bundle not found. automated even if displaying EULA could potentially cover the legal aspect, because file hosted on Oracle’s server are protected by cookie requiring a JavaScript enabled browser.”
Any ideas how I can resolve this?
I got the same issue on DS214, the shared folder named “public” was missing
I’ve just created it, upload the java package on public shared folder and tadam ! It worked…
Thanks, that helped.
After creating the directory, the rest is trivial.
So in reading the changelog for the package, it’s no longer necessary to re-install it when DSM updates? DSM 5 has locale support built in? I’m a little vague on how to *re-install* a package, unless it’s remove it and install it again.
For DS413, should I install the latest 7u79 or 7u80 please?
Neither – you need 7u75. Click the link in the instructions, which is http://tinyurl.com/javaembed
Hv alert in DS413 that there is a 1.7.0_75-0032 JAVA SE Embedded 7 available, but cannot find in Oracle site for d/l. Please kindly advise.
Click the link in the instructions on this page (or from the package error message when you try to install), which is http://tinyurl.com/javaembed
Timezone issue might be affecting me too. Even though Crashplan is running on my Syno Ds413, I’m unable to connect to it from my client – Unable to Connect To Backup Engine
I have updated the What’s New notification in Package Center to remind everyone to look at the updated blog post instructions – there’s a new requirement for the CrashPlan 4.3 client. Without this extra configuration it will fail to connect.
Ok, why does CrashPlan/Java now think that I’m not in DST?
Well, let me clarify that… I applied the latest CrashPlan pacakge, and then CP started posting log entries that made it look like the timezone was screwed. So I updated the Java package, and now the log thinks I’m a hour behind what the clock actually is.
The Synology itself has the right date and time.
Do I need to download a new Java binary from Oracle when updating the package? It didn’t tell me to, and didn’t ask to put it in the public share, either.
No, there’s no need for a new Java. It was an issue with an environment variable. My CrashPlan is also one hour out. Which timezone are you actually in?
I’m in PST8PDT. California. I have the latest version of your Java 7 and CrashPlan packages installed.
It works, just all the log entries are a hour off.
@ussohio
Did you find a resolution? Mine is *populating* the TZ variable correctly with ‘PST8PDT’, but I’m still one hour behind in the CrashPlan log.
@carsten’s comment above also seems relevant.
Thanks.
Resolution? I’m not a Java (or a Linux) expert. I worked around it by moving all my times an hour. :) I did, however, uninstall Java 7 on my DS213 and install Java 8. It didn’t change anything. This is what I currently have:
Java 1.8.0_33 from patters (THANKS!!!), using Java SE build 1.8.0_33-b05, headless
TZ=CST6CDT,M3.2.0,M11.1.0
CrashPlan 4.3.0-0033 from patters (THANKS AGAIN!!!)
SSH’ing into my DS213 and issuing the ‘date’ command gives me the correct time:
Mon Jul 13 20:01:41 CDT 2015
Starting the CrashPlan package shows me the Java/CrashPlan time:
7/13/15 7:01 PM CrashPlan started, version 4.3.0, GUID xyz….
If somebody has an idea to try, I’m all ears. I think everything will resolve itself in the fall (I’m sure this is daylight savings time related) and reoccur in the spring. :)
Problem, the latest package from Oracle is ejdk-8u51-linux-i586.gz
The Java 8 installer search for another file – 8u33 –
Even after renaming the file, it does not work!
Thanks, I have updated the package.
I’ve just updated the Java 8 package and I cannot make it “Run” it. It status remains at “Stopped” in package manager. When I try to update ChrasPlan to the latest, it tells me that Java is not installed or properly configured. I tried to reinstall the Java 8 and rebooting the NAS with no success. What should I do next?
Ok I fixed this by downloading again the JDK from Oracle, reinstalling the Java 8 package and now the status shows “Running”. I have also been able to update CrashPlan normally.
I can’t get this to install, and looking at the scripts it appears you are expecting a tar.gz file, but Oracle is only offering .gz for me to download. I tried on Java 7 and 8 and it is the same for both.
Use Firefox. All the other browsers try to un-gzip or rename the file. My script ought to catch a lot of these, but if you’re having trouble use Firefox.
After updating to CrashPlan 4.3.0 on my Mac, the client gets stuck in the loading screen. DSM as well as Java & CrashPlan app are up to date.
What am I missing here?
Uninstalling and reinstalling the app fixed the problem for me.
Java 8 can support DS413?
Yes but Oracle discontinued PowerPC support after update 6, so you need to look for the download in the archive section from the download page.
@patters, can i somehow contact you? I would be interested in my own SPK Repository Server and it seem’s there’s not much around.
Hi, I got a problem when I tried to add the repository. I followed your instruction to add but got the “invalid location” error. Could you please kindly help to resolve the problem? Thanks.
Hello, I get an update for the Java SE 0033 to update to 0034. Clicking on the update button says that I need to uninstall the old before I can install the new version. Would this break CrashPlan? Or the more appropriate question is, how does one upgrade safely without having to uninstall and reinstall the whole CrashPlan setup?
Stop CrashPlan. Uninstall Java (this won’t affect CrashPlan since it’s not actually running). Install the updated Java (see instructions on blog post). Start CrashPlan. Easy!
Thanks Patters,
Another question, since I’ve not uninstalled Java before is this done via the package manager or command line via SSH?
Thank you very much!
Yes, use the Package Center.
Hi
I’ve lately been getting the strangest error message when trying to install this package.
Below, from /var/log/synopkg.log. No log is created that I can see in the DSM package manager. Any one have ideas?
Thanks!
2015/10/05 22:56:57 (system) trigger :
Begin: /bin/tar xf /volume1/@tmp/@synopkg/@download/java7/@SYNOPKG_DOWNLOAD_java7 -C /volume1/@tmp/5612E4194C37BFB6/ conf –no-same-owner
/bin/tar: conf: Not found in archive
/bin/tar: Exiting with failure status due to previous errors
Maybe you have applied Optware to your NAS and perhaps the wrong version of the tar binary is being used? My packages are only tested on stock DSM releases, not on modified systems.
Looking more closely at this I am stumped. My scripts do not use this location so I don’t know where this command is coming from. I can only suppose that it’s some generic Package Center process inspecting the .spk file (which is a TAR archive) looking for a file called conf (not sure this is in the current published specification). It may be an unimportant error.
Thanks patters. Well spotted. Tar version is as follows. Is it not correct?
DS413> /bin/tar –version
tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
That is the typical version so I don’t think that’s the issue.
OK. Looks like the issue is still with Java 8 on the DS 413 / QorIQ package. Java 7 is running fine, I’ll stick to that!
Thanks for the help patters. Great job here!!
Pingback: Install Java on Synology
@patters, it appears that Java’s latest update has broken your Java 8 package. It’s telling me that the Java binary bundle is not found.
Fixed – updated the package to use Java 8u65. Thanks for the heads-up.
crashplan still broken on my system… again…. anyone?
1435726800441_59.jar
Hi, after installing and then ssh’ing into the Synology I get the following messages when I login:
“-ash: /volume1/@appstore/java8/ejdk1.8.0_65/linux_arm_sflt/jre/bin: Permission denied
-ash: /volume1/@appstore/java8/ejdk1.8.0_65/linux_arm_sflt/jre: Permission denied
-ash: /volume1/@appstore/java8/ejdk1.8.0_65/linux_arm_sflt/jre/lib: Permission denied
-ash: /volume1/@appstore/java8/ejdk1.8.0_65/linux_arm_sflt/jre/bin: Permission denied”
Any idea what has gone wrong?
“PATH=$PATH:/bin # Synology Java Package
JAVA_HOME= # Synology Java Package
CLASSPATH=.:/lib # Synology Java Package
LANG=en_US.utf8 # Synology Java Package
export CLASSPATH JAVA_HOME LANG PATH # Synology Java Package”
“/var/packages/java8/scripts/start-stop-status.sh: line 74: java: command not found”
“java -version
-ash: java: command not found”
How can i check what went wrong?
Downloading with firefox did help
can you change the startup so “echo `cat /var/lib/crashplan/.ui_info`” is included?
It does change every start.
I can add it to display the token value in the log, but the issue is that you can’t copy and paste from there unfortunately. It never changes for my installation, so I’m not sure why it does for some people. You’ve posted in the wrong page comments btw.
Thanks so much for this and the crashplan package! Been using them for ages.
I’m having a bit of trouble with the latest java update (8u65). Whenever I try to install it the console gives me “Failed to install Java SE Embeeded 8”, and synophg.log spews out the text at http://pastebin.com/ebQ9fSZY
Any idea whats going wrong?
Thanks
I’ve never seen that error, but it seems that it hasn’t downloaded the spk properly. Did you try rebooting the NAS in case the downloaded spk is cached somehow?
I rebooted but it didn’t make any difference – thanks anyway.
I did fix the problem, however I had to remove your repo as a source and add it back in to do it. I couldn’t find any other mention in /volume1/@appstore of java. Not sure what just happened, but its fixed.
Hi, I have a DS215+ NAS (uses Alpine processor). I installed everything as per your instructions. The JAVA SE Embedded 8 installs fine, but always showed the status as “Stopped”. Is there anyway to make it start running? I installed Serviio which also installed fine, but after installing it says “Failed to start package” – I am guessing it is because the Java SE embedded is not able to start. Any ideas?
Are you able to set me up with remote access via SSH? I haven’t confirmed this works on Alpine. However there are CrashPlan users that have reported success.
Sorry a bit of a noob with SSH. How do I do that without compromising security of my NAS?
I think you’ve done something wrong with the Java install – given it the wrong file perhaps. In this comment you’ll see confirmation that it does work on DS215+:
Hi Patters, I followed all the steps that you have written down in this install. I installed the Java Embedded 8u65 (latest available from the oracle website). I uploaded the file in my public directory and then installed the Java SE Embedded 8 from your community package center. But when I click on view log in the installed Java SE 8, it is blank and the service says “Stopped”. Any ideas?