Java SE Embedded package for Synology NAS

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.

Java Package

 

Instructions

  • In Synology DSM’s Package Center, click Settings and add my package repository:
    Add 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:
    Trust Level
  • Now browse the Community section in Package Center to install a Java SE Embedded package:
    Community-packages
    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!)
 
 

1,221 thoughts on “Java SE Embedded package for Synology NAS

  1. Andreas

    Hi,
    I installed Java on my DS213j successfully with your installer! Thanks for that. I’m also able to run my Java programs in the SSH console as user admin i.e. But when I run my Java program via the task planner (is that the right word?), I get the error “/volume1/@appstore/java7/jre/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory”.
    I did already set LD_LIBRARY_PATH to the folder where the missing library is located, but that didn’t helped.

    Do you have a clue how I make the library available to Java?

    Reply
    1. Daniel

      Hi, how did you manage to install Java? I downloaded it from oracle and placed the GZ file in my public folder. I also unpacked so there is also a TAR file. I then unpacked that file which gave me a folder named ‘ejre1.7.0_21’. Java is still needed to install Minecraft server so i am guessing i need to do some sort of an install. Also, there is no JAVA package available to me in the package center after addind the the repository.

      Reply
  2. san kaps

    Newbie help

    Just bought a the DS213+ which has the . Trying to install Java. I have the Freescale QorIQ P1022 PPC chip so I assume I need to install the following
    a) java 6 ==> is that correct?
    b) I created a “public” share. When I look at the properties on the DS File station, I see /volume1/public. Is this correct.
    c) I then go to the package center and select manual install. I use the browse function to go to the java file that I downloaded. I choose the What file must I select to install Java.

    Reply
  3. Mitchell

    I was unable to install the Java SE due to being unable to find the 7u21 version. It appears that the current version is “Oracle Java SE Embedded version 7 Update 40 (7u40)”. I was able to find 7u2, 7u4, and 7u10 in the archives. Will the java 7 package be updated soon?

    Reply
    1. Mitchell

      i was able to install java 7u40 by manually running the install script from the console after running the script once. I had to rename 7u40 to match the 7u21 filename to get the script to execute. But i think that it is successfully installed now…

      Reply
  4. Justin

    The package installer says that it wants the file “ejre-7u21-fcs-b11-linux-arm-sflt-headless-04_apr_2013.tar.gz” in the public dir; however, this file is nowhere to be found at the url listed in the dialog, nor can I find it anywhere on the Oracle website; the current version they’re distributing is ejre-7u40-fcs-b43-linux-arm-sflt-headless-27_aug_2013.tar.gz. Even the Java SE Embedded Archive page does not contain this “7u21” version (they only have 2, 4, and 10). I’ve tried Googling, FTP search engines, everything I can think of – but the version that the installer insists on using just doesn’t seem to be available anywhere. How on earth can I install this package if it requires a file that’s nowhere to be found…??

    Reply
  5. Micke

    Would it be possible to update the script to use latest Java SE Embedde update 40 version? I’m not able to find and download update 21 version.

    Reply
  6. patters Post author

    I have published an updated package for Java 7u40. Oracle seem to have slightly changed the builds that are on offer – there’s now a build for ARMv6/7 with hardware FPU, which should work on a DS213j. Can someone test on that model and report back here? Thx

    Reply
    1. oinkesfabuloso

      Reporting from a DS212J:

      Filename: ejre-7u40-fcs-b43-linux-arm-sflt-headless-27_aug_2013.tar.gz
      The new package on your repo complains with the following error:

      Says is searching for file:
      /volume1/public/ejre-1_6_0_38-fcs-b05-linux-arm-sflt-eabi-headless-13_nov_2012.tar.gz

      Reply
  7. Nelis

    Thanks for the update. I’ve tried to install the updated package on my DS213j, but I can’t get it to work. It looks like Java7 is active, but the log shows: “/var/packages/java7/scripts/postinst: line 28: java: not found”

    I’ve searched for a solution in the comments, but i’m not sure what causes it or how to solve this issue.

    Reply
      1. Kane

        Anybody having a solution for that “line 28: java: not found”-Error?
        Same here with DS213j and the java7 package

  8. Markus

    Hi. Many thanks for all of your work! I have a question: how can I start a web hosted *.jnlp program/applet? I have a “Smart Meter” and I hope I can run the Java software on my ds213j. Can anyone help?

    Reply
  9. neilandrewcerullo

    I tried this as well.
    I have the DS1813+
    I was unable to get the package to find the correct JAVA package, so I tried downloading them all of the possible JAVA packages and leaving them in the “public” folder. This still did not work.

    Not sure what to do here, none of the Java files are working, and I cannot install the CrashPlan Package.

    Reply
  10. megawaly

    Hi patters, I can confirm that downloading the soft-float Java package and renaming sflt to hflt it installs and runs with no issues. I now have serviio back up and running :)

    Reply
  11. Maxim

    It seems DS213j requires Java with soft-float ABI (calling convention). Oracle builds Java using following GCC options:
    SoftFP ABI -mfloat-abi=softfp -mfpu=vfp
    HardFP API -mfloat-abi=hard -mfpu=vfp.

    Description of this option:
    -mfloat-abi=name
    Specifies which floating-point ABI to use. Permissible values are: `soft’, `softfp’ and `hard’.

    Specifying `soft’ causes GCC to generate output containing library calls for floating-point operations. `softfp’ allows the generation of code using hardware floating-point instructions, but still uses the soft-float calling conventions. `hard’ allows generation of floating-point instructions and uses FPU-specific calling conventions.

    The default depends on the specific target configuration. Note that the hard-float and soft-float ABIs are not link-compatible; you must compile your entire program with the same ABI, and link with a compatible set of libraries.

    I could not run Java with HardFP on my DS231j, but SoftFP worked fine.

    Reply
  12. patters Post author

    Hi all,

    I have updated the package so that it requests the correct Java package for the DS213j. Thanks winxi and Maxim for the comments, unfortunately I didn’t have time to research the issue straight away (not owning that model myself).

    I left the version number the same to avoid forcing everyone else to upgrade, so just uninstall and re-install the Java package to get the fixed version.

    Reply
    1. Philippe

      Hello Patters,

      As a simple Synology DS413j user, I have a question: there currently two versions of Java7 packages for my NAS, yours and the one from Missilehhugger, so which one to use as they do not not allow the same packages to run (e.g. subsonic and yamj) ? Missilehugger spk package says that the java executable is stored in /usr/local/javal/bin/java while yours is somewhere else…
      Do you have a pice of advice ?
      Thank you in advance

      Reply
    2. Fred Dunayer

      On DS213j, Openremote won’t start. Message: ./openremote.sh: line 326: /volume1/@appstore/java7/jre/bin/java: not found. Strange thing is that I can go to the directory and see the java file, but get a file not found if I try to execute it; using “cat” throws machine language into the telnet window.. Using the latest version in package center for both Java 7 and Openremote. Permissions look good.

      Reply
  13. Chris

    Hi,
    I’m having the same error as Fred above, but for the CrashPlan app: it can’t find /volume1/@appstore/java7/jre/bin/java though it is there.

    Reply
  14. winxi

    Hi patters,
    it seems that the package on the DS213j still asks for the file
    ejre-7u40-fcs-b43-linux-arm-vfp-hflt-client_headless-27_aug_2013.tar.gz
    although it should be
    ejre-7u40-fcs-b43-linux-arm-vfp-sflt-client_headless-27_aug_2013.tar.gz

    Reply
    1. patters Post author

      Thanks winxi. Fixed now (sorry for the delay). I had downloaded the finished package via my work PC ready to upload to my repo, but I hadn’t realised it had saved it with a “_1” on the end of the filename. I had accidentally re-uploaded the broken version. Oops.

      Reply
  15. Chris

    Hi patters,
    I’m trying to install Crashplan on a DS213j, installed the Java SE 7 successfully (at least it seems so), but the Crashplan installer keeps telling me the no Java is installed. Any ideas?
    Thanks in advance for your response

    Reply
  16. ColaCheater

    I also had problems with the install on a DS213j.
    After installing all the files were copied to the correct place but the …/jre/bin/java didn’t work. The log said in the first line something like “java: file not found” and running “java” in the ssh-Terminal gave the same output.

    Because of the comment from winxi I then tried it with the …-sflt-… file.
    I uninstalled the package, deleted the ejre-7u40-fcs-b43-linux-arm-vfp-hflt-client_headless-27_aug_2013.tar.gz file from the public folder, downloaded the ejre-7u40-fcs-b43-linux-arm-vfp-sflt-client_headless-27_aug_2013.tar.gz, copied it to the public folder and renamed it to …-hflt-…
    After reinstalling your package again it now works. (At least the java command gives some output)

    It seems like sflt is the correct instead of hflt? If so you maybe you can correct this in the installer so we don’t have to rename the file ;)

    Reply
  17. Chris

    Hi, I have a DS209 Marvell 88F6281 i think it should be supported, but I keep getting the following error, after uploading the file 100%. “You are not authorized to use this service” so can’t even get the java file in the public folder.

    Reply
  18. Alfred Wu

    Hi,

    I am using Synology DS213 (not “+”) on DSM 4.3 and last I check it is the Marvell Kirkwood mv6282 ARMv5te – which should be supported for Java SE for Embedded 7 right?

    Downloaded the Java file and uploaded to the public folder.

    However, when I tried the 3rd point as per instructed above — Install the Java package from the DSM Package Center. In Settings -> Package Sources add my package repository URL which is http://packages.pcloadletter.co.uk.

    The end result is that Synology failed to save the URL to the package sources.

    Am stuck at this step. Is it a compatibility issue with DSM 4.3 or the DS213?

    Thanks

    Reply
  19. Dieter

    On a Synology DS213+ (CPU: Freescale QorIQ P1022 PPC) libNRJavaSerial does not work:

    java.lang.UnsatisfiedLinkError: /tmp/libNRJavaSerial_root_0/libNRJavaSerial.so: /tmp/libNRJavaSerial_root_0/libNRJavaSerial.so: ELF file data encoding not big-endian (Possible cause: endianness mismatch)
    Is there anything I can do to resolve this?

    Reply
    1. patters Post author

      A file ending in .so is a shared library so it’s native code, not Java. You would probably need to use the Synology toolchain to cross compile that particular library yourself, which can be quite tricky. I had a lot of trouble compiling some other Java native libs for the ARMv7 CrashPlan package.

      Reply
    2. svdgouw

      Hi Dieter,
      I just ran into the same problem on my DS213+ when OpenHAB (home domotica) tries to connect to RFXtrx433E. Any solution available, since you’ve had over a year to fix the problem :-)

      Reply
      1. patters Post author

        The fact that the library file has been extracted to the temp folder probably means that it is included with the OpenHAB software. You could try to ask them to include binaries for multiple architectures for that library. According to the homepage it’s OSGI compliant which means it can have multiplatform binary dependencies included (like the Bliss package). You would need a generic PowerPC compiled binary. Have you tried copying this one to the temp folder location specified in the error from Dieter’s post:
        https://github.com/NeuronRobotics/nrjavaserial/blob/master/nrjavaserial/src/main/c/resources/native/linux/PPC/libNRJavaSerial.so

  20. Alfred Wu

    Hi

    I am using DS213 (ver 4.3) which is the Marvell Kirkwood mv6282 ARMv5te. I have downloaded the Java SE for Embedded 7 and uploaded to the Public folder.

    However, when I installed the Java package from the DSM Package Center. In Settings -> Package Sources add my package repository URL which is http://packages.pcloadletter.co.uk, the packages repository URL failed to save. Hence I can’t proceed to the next step.

    Is it the DS213 model and/or the ver 4.3 that is affecting the Java installation?

    Thanks

    Reply
  21. mo

    Can you please add support for Armada XP CPU? I just bought a DS214 NAS. Added http://packages.pcloadletter.co.uk/ to the Package Sources, but can only see Minecraft, CraftBukkit and OpenRemote apps. Can not see JAVA SE (i thought because of the lack of CPU support) and Serviio packages.

    Reply
  22. Tomas

    Hello.

    Thank you for your great package. Would it be possible to talk to you directly via e-mail or something? The thing is that I would like to create some packages of my own, so that the installation process may be streamlined for other SW I would like to use with java as well.
    For example I used your java package to set-up a running tomcat instance on my NAS (DS413j). I created an /opt directory and installed tomcat there. But I think it would be better to install the server via the synology packaging system as well so that the other would benefit too.

    And one more thing: the Java version that the package installs is a JRE. While it suffices for basic function of tomcat >6.0, other SW (like native tomcat libs, maven, ant and automated build systems) require use of JDK. Is it possible to install JDK for embedded systems as well? How could it be done?

    Looking forward to your reply.
    Tomas

    Reply
  23. Christophe

    Hello,

    I’ve a Synology 413, with a Freescale QorIQ arch. So I was thinking that Java 7 was supported on it.
    But when I add your repo, I only find Java 6se for install.
    There is something I don’t understood ?

    Thanks

    Reply
  24. Jason

    Hi,

    Running a DS211 and really hoping to get CrashPlan up and running, but I don’t see any Java packages at all. I do see the CP packages and the Minecraft ones, so the repository is working for me. Is it a compatibility issue (still running DSM 3.2 as we haven’t had a need to upgrade)? Seems to have the right CPU according to the CPU list. Any ideas would be appreciated. Thanks.

    Reply
  25. Evan

    It’s been a while since you’ve posted replies to comments here. I thought I’d try, though.

    I have an Intel Atom in my 1812+, but I was wondering if I could help investigate the problem with Java 7 with you. I am trying to specifically install JIRA 6.x after finding a way to get 5.x installed (the last supporting Java 6). Of course we’re now on DSM4.3 now, so I’m not sure if you’ve kept up with that as well.

    Did you have any ideas as to what to look for as far as this incompatibility if you had one of these Intel devices within reach?

    Reply
    1. hal sandick

      I’m having the same issue. Can’t see java se embedded 7? can you post the package file?

      ds213+, dsm 4.2-3211

      Thanks.

      Hal Sandick

      Reply
      1. Jason

        Just a quick followup in case anyone is curious…yes, it seems that DSM 4 was required. Having upgraded the NAS, I now have Java & Crashplan running. Patters, thanks for these packages.

  26. Pingback: OpenHAB for Synology diskstation | the edge (D.H.)

  27. Maleko

    I have limited knowledge about this stuff so I’m having difficulty determining which Oracle Java SE Embedded version 7 file I should download for my Synology DS213+ that has CPU Model Freescale QorIQ P1022

    Reply
  28. matt

    I’m running DSM 4.3-3810 on a DS411. I had Java going (to support the Crashplan package) before I updated to 4.3, but the installed Java Package has disappeared and I am not seeing it in the pcloadletter repository. I’ve re-added it, rebooted, refreshed, etc…any ideas?

    Thanks!

    Reply
  29. Jeff3F

    Hi there–I’m a fan, and have been (successfully) using your stuff for crashplan on my ARMv5 diskstation.

    But, I (duh) recently updated everything, and now it turns out that I can’t install the latest (the only one I can find) version of java, which is update 51. your software is working with the assumption that the latest version (v7) is update 21!

    so, two questions. one, can you please update your stuff so that it works with what Oracle makes available for download from their site
    two, if not can I trick java into just installing (ie rename the target gz file)?
    oh, and three–do you simply know where (preferably from oracle.com) I can download the v7 update 21 that apparently works with your channel update??

    thanks!

    Reply
  30. Thibsie

    Hi, it would seem glib was finally upgraded on DS410 beta 5:
    Would be VERY cool if Java finally could work…

    THX :)

    DiskStation_b5> cat /lib/libc.so.6 | grep GLIB
    GLIBC_2.0
    GLIBC_2.1
    GLIBC_2.1.1
    GLIBC_2.1.2
    GLIBC_2.1.3
    GLIBC_2.2
    GLIBC_2.2.1
    GLIBC_2.2.2
    GLIBC_2.2.3
    GLIBC_2.2.4
    GLIBC_2.2.6
    GLIBC_2.3
    GLIBC_2.3.2
    GLIBC_2.3.3
    GLIBC_2.3.4
    GLIBC_2.4
    GLIBC_2.5
    GLIBC_2.6
    GLIBC_2.7
    GLIBC_2.8
    GLIBC_PRIVATE
    DiskStation_b5>

    Reply
      1. Thibsie

        Sure, here it is:

        DiskStation_b5> uname -a
        Linux DiskStation 2.6.32.12 #4418 Tue Jan 28 16:55:07 CST 2014 ppc GNU/Linux synology_ppc853x_410
        DiskStation_b5>

      2. patters Post author

        Ok, I’ve amended the repository to offer the Java 7 package to x86 and ppc853x CPU architectures only when running DSM build 4418 or newer. Does it work? Can you run java -v once installed?

      3. Thibsie

        Better but not there yet…
        The package appears but running it, package center complains about wrong architecture (packet not meant for this * translated from the french *).

      4. Thibsie

        Works !!
        Installs as supposed and at least capable of running Subsonic so this is it !

        Thank you so much :)

      5. patters Post author

        Excellent! I will fix up the other packages which already have PowerPC binaries like Serviio, CrashPlan etc. later today. Those 2010 Synology models just became a lot more useful :)

      6. patters Post author

        I’ve just updated Serviio. Can you try installing it and running /volume1/@appstore/Serviio/bin/ffmpeg
        Does it run ok?

      7. Thibsie

        As for Serviio:

        DiskStation> ffmpeg
        ffmpeg version 2.0.2 Copyright (c) 2000-2013 the FFmpeg developers
        built on Jan 18 2014 22:45:29 with gcc 4.3.2 (GCC)
        configuration: –prefix=/usr/syno –incdir=’${prefix}/include/ffmpeg’ –arch=powerpc –target-os=linux –cross-prefix=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe- –enable-cross-compile –enable-optimizations –enable-pic –enable-gpl –enable-shared –disable-static –enable-version3 –enable-nonfree –enable-libfaac –enable-encoders –enable-pthreads –disable-bzlib –disable-protocol=rtp –disable-muxer=image2 –disable-muxer=image2pipe –disable-swscale-alpha –disable-ffserver –disable-ffplay –disable-devices –disable-bzlib –disable-altivec –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libmp3lame –disable-decoder=amrnb –disable-encoder=zmbv –disable-encoder=dca –disable-encoder=ac3 –disable-encoder=ac3_fixed –disable-encoder=eac3 –disable-decoder=dca –disable-decoder=eac3 –disable-decoder=truehd –cc=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-ccache-gcc
        libavutil 52. 38.100 / 52. 38.100
        libavcodec 55. 18.102 / 55. 18.102
        libavformat 55. 12.100 / 55. 12.100
        libavdevice 55. 3.100 / 55. 3.100
        libavfilter 3. 79.101 / 3. 79.101
        libswscale 2. 3.100 / 2. 3.100
        libswresample 0. 17.102 / 0. 17.102
        libpostproc 52. 3.100 / 52. 3.100
        Hyper fast Audio and Video encoder
        usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…

        Use -h to get full help or, even better, run ‘man ffmpeg’
        DiskStation>

        Seems alright to me …

      8. patters Post author

        Actually, this is wrong. You launched the DSM build of FFmpeg, not the Serviio one. You need to make sure to use the full path:
        /volume1/@appstore/Serviio/bin/ffmpeg

      9. Thibsie

        ouch, indeed. Sorry about that.
        Here it is:

        DiskStation> /volume1/@appstore/Serviio/bin/ffmpeg
        ffmpeg version 2.1-compiled_by_patters_for_Serviio Copyright (c) 2000-2013 the FFmpeg developers
        built on Nov 7 2013 00:14:07 with gcc 4.3.2 (GCC)
        configuration: –arch=ppc –cpu=e500v2 –enable-cross-compile –cross-prefix=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe- –target-os=linux –prefix=/usr/local/powerpc-none-linux-gnuspe –enable-shared –disable-static –enable-pic –disable-ffplay –disable-ffserver –disable-debug –enable-pthreads –enable-libmp3lame –enable-librtmp –enable-libass –enable-libx264 –enable-gpl –pkg-config=pkg-config –extra-version=compiled_by_patters_for_Serviio
        libavutil 52. 48.100 / 52. 48.100
        libavcodec 55. 39.100 / 55. 39.100
        libavformat 55. 19.104 / 55. 19.104
        libavdevice 55. 5.100 / 55. 5.100
        libavfilter 3. 90.100 / 3. 90.100
        libswscale 2. 5.101 / 2. 5.101
        libswresample 0. 17.104 / 0. 17.104
        libpostproc 52. 3.100 / 52. 3.100
        Hyper fast Audio and Video encoder
        usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…

        Use -h to get full help or, even better, run ‘man ffmpeg’
        DiskStation>

        Crashplan installed: is there a GUI somewhere I should be able to access? Can’t see one.

      10. Thibsie

        Serviio console from Synology won’t show a thing though so no password setting possible.

        A couple other apps still don’t work and complain about installing Java including (from MissileHunger among others) FileBot, Funambol, MailStation Plus, Rootkit Hunter.

        BubbleUpnp works fine :)

      11. patters Post author

        That may be because MissileHugger is possibly only checking for his own Java package, rather than checking for the existence of the $JAVA_HOME environment variable.

        Nice to see that FFmpeg is ok, thanks for testing. For Serviio, it will be working – it’s just that you need to run the console application from your computer (having configured it to connect to the NAS IP – see the notes). The website that’s linked to in DSM is the Media Browser, which you need to configure in the console application first.

        I have added support for CrashPlan now as well.

  31. Bart

    hey There, I’ve been trying to get java installed on my synology ds214+, but unfortunately all my attempts have failed so far. The program installs just fine, but when I try to use it (through other programs) it starts complaining about my JAVA_HOME. Upon further investigation (with the echo command) I can verify that the JAVA_HOME is indeed empty. trying to set it with export doesn’t seem to work and java -version also doesn’t seem to work. Any idea what might be causing this and more importantly how to fix it? Any help is appreciated!

    Reply
    1. Frank

      ejre-7u51-fcs-b13-linux-arm-vfp-sflt-server_headless-18_dec_2013.tar.gz installs without a hitch on ds214+

      To check it from the shell, try typing
      $ source /etc/profile
      $ java -version

      Or log out and log in again
      I haven’t tried it yet with any third-party apps, but my own java class files run flawlessly

      Reply
      1. Bart

        first one gives permission denied and the second one gives version not found :/ I first thought it might be my shell program not giving the proper rights but I’ve tried several in the meantime and it’s still not working.

    2. Frank

      If it installed correctly then after logging in as admin you should see your JAVA_HOME set up correctly in both /etc/profile and in /volume1/homes/admin/.profile.

      Reply
  32. patters Post author

    Please can someone confirm whether my Java 7 package works on Intel CPUs running DSM 5.0 beta? I think the Synology Java Manager is installing the full JRE, whereas my package is installing Java for Embedded, so it’s still useful for saving memory.

    Reply
    1. Duc Tran

      The Java 7 package isn’t made available to the Intel CPUs(other than evansport) to test on DSM 5.0 beta. I am willing to test it. I have a DS713+. The Synology Java Manager installs the full JDK which uses the full JRE.

      Reply
    2. Duc Tran

      Thanks for the update. I installed the package the other day. The install worked correctly. I use java mainly for Crashplan. There hasn’t been any issues. The embedded JRE uses around 300MB while Crashplan is running and 100MB while sleeping. The desktop JRE runs around 475MB all the time.
      The only problem I noticed is the UID and GID is kept from the tar archive, 10 and 143 respectively, for the jre folder.

      Reply
      1. Duc Tran

        Yes, the ownerships are a security vulnerability. The account with UID 10 can replace the java executable and libraries. Only one file, README, is group writable. That file is open for modification to GID 143. That maps to the dovecot group used by the mail server process. I changed mine to be root:root to match the other package files.

  33. BartV

    Should it work on DS207+ Marvell Orion mv5281 ARM with the latest DSM (3.1)
    Thanks for your response!

    Reply
      1. BartV

        I’m already much obliged for your response. (I’m pretending not having read the last bit…)
        So here goes :
        BusyBox v1.16.1 (2011-10-23 04:33:17 CST) built-in shell (ash)
        Enter ‘help’ for a list of built-in commands.

        DiskStation0> cat /proc/cpuinfo
        Processor : ARM926EJ-Sid(wb) rev 0 (v5l)
        BogoMIPS : 499.71
        Features : swp half thumb fastmult vfp edsp
        CPU implementer : 0x41
        CPU architecture: 5TEJ
        CPU variant : 0x0
        CPU part : 0x926
        CPU revision : 0
        Cache type : write-back
        Cache clean : cp15 c7 ops
        Cache lockdown : format C
        Cache format : Harvard
        I size : 32768
        I assoc : 1
        I line length : 32
        I sets : 1024
        D size : 32768
        D assoc : 4
        D line length : 32
        D sets : 256

        Hardware : MV-88fxx81
        Revision : 0000
        Serial : 0000000000000000
        DiskStation0> uname -a
        Linux DiskStation0 2.6.15 #1636 Sun Oct 23 04:20:59 CST 2011 armv5tejl GNU/Linux synology_88f5281_207+

      2. BartV

        Hello,
        I posted my reply on your posting of march 4th hereunder.
        -Do you think installing your package “http://packages.pcloadletter.co.uk/downloads/java1.7.0_51-merged-0023.spk” will make any difference, or could there be another reason that java isn’t executing?
        Thanks, Bart

  34. BartV

    To be completely honest, I already did some efforts installing java by the instructions on this page, before.
    As it stands, I have the package listed in Package management, but when I telnet into the server it apparently cannot execute java (although the x flag is on)
    DiskStation0> cd /volume1/@appstore/java/bin/
    DiskStation0> dir
    drwxrwxrwx 2 root root 4096 Feb 19 20:08 .
    drwxr-xr-x 4 root root 4096 Jan 29 23:53 ..
    -rwxrwxrwx 1 root root 3368 Apr 4 2013 java
    -rwxrwxrwx 1 root root 3468 Apr 4 2013 keytool
    DiskStation0> java -version
    -ash: java: not found
    DiskStation0> cd /usr/local/java/bin/
    DiskStation0> dir
    drwxrwxrwx 2 root root 4096 Feb 19 20:08 .
    drwxr-xr-x 4 root root 4096 Jan 29 23:53 ..
    -rwxrwxrwx 1 root root 3368 Apr 4 2013 java
    -rwxrwxrwx 1 root root 3468 Apr 4 2013 keytool
    DiskStation0> java -version
    -ash: java: not found
    DiskStation0>
    For the time being, I did not yet install your new package. Thx.

    Reply
  35. Shak

    Hi, thank you for the great work. Can I ask what the difference is between this Java install and the one that can be invoked via the Synology Java Manager package?

    I particularly want to run your Crashplan package. Is that possible with the Synology package?

    Reply
    1. Shak

      Oh and a follow up – I’m running Xpenology but cannot see the Java SE for Embedded 7 package from your repo. 6 works great btw.

      I saw the previous post asking for info and have the following:

      Linux HomeNAS 3.2.40 #68 SMP Fri Feb 21 20:25:08 CET 2014 x86_64 GNU/Linux synology_bromolow_3612xs

      processor : 0
      vendor_id : AuthenticAMD
      cpu family : 16
      model : 6
      model name : AMD Athlon(tm) II Neo N36L Dual-Core Processor
      stepping : 3
      microcode : 0x10000c8
      cpu MHz : 1297.819
      cache size : 1024 KB
      physical id : 0
      siblings : 2
      core id : 0
      cpu cores : 2
      apicid : 0
      initial apicid : 0
      fpu : yes
      fpu_exception : yes
      cpuid level : 5
      wp : yes
      flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 3dnowprefetch osvw ibs skinit wdt nodeid_msr npt lbrv svm_lock nrip_save
      bogomips : 2595.63
      TLB size : 1024 4K pages
      clflush size : 64
      cache_alignment : 64
      address sizes : 48 bits physical, 48 bits virtual
      power management: ts ttp tm stc 100mhzsteps hwpstate

      processor : 1
      vendor_id : AuthenticAMD
      cpu family : 16
      model : 6
      model name : AMD Athlon(tm) II Neo N36L Dual-Core Processor
      stepping : 3
      microcode : 0x10000c8
      cpu MHz : 1297.819
      cache size : 1024 KB
      physical id : 0
      siblings : 2
      core id : 1
      cpu cores : 2
      apicid : 1
      initial apicid : 1
      fpu : yes
      fpu_exception : yes
      cpuid level : 5
      wp : yes
      flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 3dnowprefetch osvw ibs skinit wdt nodeid_msr npt lbrv svm_lock nrip_save
      bogomips : 2595.81
      TLB size : 1024 4K pages
      clflush size : 64
      cache_alignment : 64
      address sizes : 48 bits physical, 48 bits virtual
      power management: ts ttp tm stc 100mhzsteps hwpstate

      Reply
    1. patters Post author

      Yep. As long as you’re running DSM5.0 beta or newer, you will notice that my repo will offer Java Embedded 7 for Intel systems. A few people have asked how mine is different from the Synology one – Java Embedded uses less memory. The Synology version is the full JRE which, given these are headless systems is not generally required.

      Reply
      1. toto

        for crashplan, do you recommend Java V7 or V8 ? the java V7 is 30MB, the V8 is 108!!!
        Crashplan is working nicely on my 412+ with the V7

    1. John Paul Broad

      This is the file the package asks for, but I can’t seem to download it from any source. The links above produce a 404 error now . . . :(

      Reply
  36. Oleg

    Sorry, but how to set $JAVA_HOME in DS413? I cannot install Serviio due to environment is not set. But JAVA8 is installed as package (Java SE Embedded 8). DSM upgraded to v.5, previously all works fine.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s