Java SE Embedded package for Synology NAS

UPDATE 4 – Now supports DS414j!
UPDATE 3 – Now with Java 8, and full support for all versions on Intel CPUs running DSM 5.0!
UPDATE 2 – Now running on PowerPC 2010 Synology models running DSM 5.0 beta!
UPDATE – Now running on Armada 370/XP (ARMv7) and Intel Atom Evansport CPUs, as used in some x14 series Synology models!

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. To stay legal, I followed how QNAP packaged Java for their NAS products. 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.

Only Marvell Kirkwood, Marvell Armada 370/XP, Intel, and Freescale QorIQ/PowerQUICC PowerPC CPUs are supported, so please check which CPU your NAS has. Java 7 for Intel Atom CPU does not currently work on Synology systems running DSM versions older than 5.0, so those users are limited to Java 6. Though Oracle have published a JRE for PowerPC, it also requires DSM 5.0. PowerQUICC PowerPC synos running older DSM versions do not have a recent enough glibc version (2.3.4, but Oracle’s Java needs 2.4). It is technically possible to run Java on those units, but it requires chroot-ing to a Debian install which can get complicated. Christophe from chreggy.fr has recently released packages to automate this.

Java package for Synology

 

Instructions

  • 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 Java SE for Embedded 7 for either ARMv5, ARMv7 Headless Server, or PowerPC e500v2 as appropriate (Intel NAS users will need the end-of-life Java SE for Embedded 6), and save in the public shared folder. If the file isn’t found an error message will display the full expected filename. You cannot use a different version by renaming it, since the folder structure inside the archive will be different.
  • 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. My packages will appear in the Community section once the repo URL is added.
  • 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.
  • The package does not need to start, just installing it is sufficient.
  • If you update DSM later, you will need to re-install this package or else UTF-8 and locale support will be broken by the update.
 

Package scripts

For information, here are the package scripts so you can see what it’s going to do. You can learn more about how Synology packages work by reading the Synology Package wiki.

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"
cat /proc/cpuinfo | grep "Comcerto 2000" > /dev/null && SYNO_CPU_ARCH="armv7l-neon"
[ "${SYNO_CPU_ARCH}" == "x86_64" ] && SYNO_CPU_ARCH="i686"

if [ "${SYNOPKG_PKGNAME}" == "java6" ]; then
  DOWNLOAD_URL="http://tinyurl.com/javaembedarchive"
  EXTRACTED_FOLDER="ejre1.6.0_38"
  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}" == "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_60"
  if [ "${SYNO_CPU_ARCH}" == "armv5tel" ]; then
    JAVA_BINARY="ejre-7u60-fcs-b19-linux-arm-sflt-headless-07_may_2014.tar.gz"
    JAVA_BUILD="ARMv5 Linux - Headless EABI, SoftFP ABI, Little Endian"
  elif [ "${SYNO_CPU_ARCH}" == "armv7l" ]; then
    JAVA_BINARY="ejre-7u60-fcs-b19-linux-arm-vfp-sflt-client_headless-07_may_2014.tar.gz"
    JAVA_BUILD="ARMv6/7 Linux - Headless - Client Compiler EABI, VFP, SoftFP ABI, Little Endian"
  elif [ "${SYNO_CPU_ARCH}" == "armv7l-neon" ]; then
    JAVA_BINARY="ejre-7u60-fcs-b19-linux-arm-vfp-hflt-client_headless-07_may_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-7u60-fcs-b19-linux-i586-headless-07_may_2014.tar.gz"
    JAVA_BUILD="x86 Linux Small Footprint - Headless"  
  elif [ "${SYNO_CPU_ARCH}" == "ppc" ]; then
    JAVA_BINARY="ejre-7u60-fcs-b19-linux-ppc-e500v2-headless-07_may_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_06"
  if [ "${SYNO_CPU_ARCH}" == "armv5tel" ]; then
    JAVA_BINARY="ejdk-8u6-fcs-b23-linux-arm-sflt-12_jun_2014.tar.gz"
    JAVA_BUILD="ARMv5 Linux - Headless EABI, SoftFP ABI, Little Endian"
  elif [ "${SYNO_CPU_ARCH}" == "armv7l" ]; then
    JAVA_BINARY="ejdk-8u6-fcs-b23-linux-arm-vfp-sflt-12_jun_2014.tar.gz"
    JAVA_BUILD="ARMv6/7 Linux - VFP, SoftFP ABI, Little Endian"
  elif [ "${SYNO_CPU_ARCH}" == "armv7l-neon" ]; then
    JAVA_BINARY="ejdk-8u6-fcs-b23-linux-arm-vfp-hflt-12_jun_2014.tar.gz"
    JAVA_BUILD="ARMv7 Linux - VFP, HardFP ABI, Little Endian"
  elif [ "${SYNO_CPU_ARCH}" == "i686" ]; then
    JAVA_BINARY="ejdk-8u6-fcs-b23-linux-i586-12_jun_2014.tar.gz"
    JAVA_BUILD="x86 Linux Small Footprint - Headless"
  elif [ "${SYNO_CPU_ARCH}" == "ppc" ]; then
    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"
  fi
fi

JAVA_BINARY=`echo ${JAVA_BINARY} | cut -f1 -d'.'`
PUBLIC_FOLDER="`cat /usr/syno/etc/smb.conf | sed -r '/\/public$/!d;s/^.*path=(\/volume[0-9]{1,4}\/public).*$/\1/'`"
TEMP_FOLDER="`find / -maxdepth 2 -name '@tmp' | head -n 1`"
NATIVE_BINS_URL="http://packages.pcloadletter.co.uk/downloads/java-native-${SYNO_CPU_ARCH}.tgz"   
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 ()
{
  if [ -z ${PUBLIC_FOLDER} ]; then
    echo "A shared folder called 'public' could not be found - note this name is case-sensitive. "
    echo "Please create this using the Shared Folder DSM Control Panel and try again."
    exit 1
  fi

  JAVA_BINARY_FOUND=

  if [ ! -z ${JAVA_HOME} ]; then
    echo "It seems from /etc/profile that a Java Runtime is already installed at ${JAVA_HOME}. Uninstall it and try again."
    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. "
    echo "Please agree to the Oracle licence at ${DOWNLOAD_URL}, then download the '${JAVA_BUILD}' package"
    echo "and place it in the 'public' shared folder on your NAS. This download cannot be automated even if "
    echo "displaying a package EULA could potentially cover the legal aspect, because files hosted on Oracle's "
    echo "server are protected by a session cookie requiring a JavaScript enabled browser."
    exit 1
  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, "
        echo "which was \"${WGET_URL}\" "
        echo "Alternatively, you may download this file manually and place it in the 'public' shared folder. "
        exit 1
      fi
    fi
  done
  
  exit 0
}


postinst ()
{
  WORKING_DIR=`pwd`
  
  #ldd tool is very useful but not included in DSM
  [ ! -e /bin/ldd ] && cp ${SYNOPKG_PKGDEST}/tools/ldd-${SYNO_CPU_ARCH} /bin/ldd

  #DSM versions older than 4.3 need locale support adding
  if [ ! -e /usr/bin/locale ]; then
    #extract native binaries
    cd ${SYNOPKG_PKGDEST}
    tar xzf ${TEMP_FOLDER}/${NATIVE_BINS_FILE} && rm ${TEMP_FOLDER}/${NATIVE_BINS_FILE}

    #build missing locale with UTF-8 support (don't think it matters which language)
    cp ${SYNOPKG_PKGDEST}/bin/* /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  

  #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
  
  #change owner of folder tree
  chown -R root:root ${SYNOPKG_PKGDEST}

  echo "NOTE - This package does *not* start and stop like other packages. "
  echo "Java is correctly installed if you can see the runtime and HotSpot version numbers, "
  echo "and locale information in the package Log tab."
  
  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 ${SYNOPKG_PKGDEST} -name jre`"
COMMENT="# Synology Java Package"

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

    #set the current timezone for Java so that log timestamps are accurate
    #we need to use the modern timezone names so that Java can figure out DST
    #this should be configured in each Java daemon's start script to that changes
    #to timezone settings in DSM are reflected
    #we need to use the modern timezone names so that Java can figure out DST

    SYNO_TZ=`cat /etc/synoinfo.conf | grep timezone | cut -f2 -d'"'`
    SYNO_TZ=`grep "^${SYNO_TZ}" /usr/share/zoneinfo/Timezone/tzname | sed -e "s/^.*= //"`
    echo TZ=\'${SYNO_TZ}\' ${COMMENT} >> /root/.profile
    echo "export PATH TZ ${COMMENT}" >> /root/.profile
  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
 

Changelog:

  • 0027 Updated Java 8 to 8u6m, added support for Mindspeed Comcerto 2000 CPU in DS414j for Java 7 and Java 8
  • 0026 DSM updates will no longer break Java
  • 0025 Updated to Java 7u60
  • 0024 Updated to Java 7u55
  • 0023 Added Java 8 support
  • 0022 Updated to Java 7u51
  • 0021 Locale support is no longer downloaded and added to DSM 4.3 or newer since it’s already present
  • 0020 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 Updated to Java 7u45
  • 0018 Updated to Java 7u40, and JDK8 Early Access b106
  • 0017 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 Added Armada370 CPU support (DS213j)
  • 0015 Updated to Java 7u21, Java 6 Embedded seems to be no longer maintained by Oracle
  • 0014 Fixed metadata for DSM 4.2 Package Center
  • 013 Updated to Java 6u38 and Java 7u10
  • 012 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 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!)
 
 
About these ads

759 thoughts on “Java SE Embedded package for Synology NAS

      1. womke

        I’ve problems with adding your repository URL to Package Center. Got the Error Message ‘Ungültiger Speicherort’ which means ‘incorrect location’. Any idea?
        thx

      2. patters Post author

        I saw on the Serviio Twitter feed that the serviio.org webhost is having issues. I use the same host, so my repo may be down currently for some users.

    1. Romme

      Have added the package repository URL to my DS509+, but no packaged for java are available in the package center.

      Reply
  1. Nick

    Thanks so much for your efforts … having my Synology backup with CrashPlan helps me sleep well at night.

    Reply
  2. Radjesh

    plz help me

    can’t install Serviio because

    Java is not installed or not properly configured. The Java Binary could not be located.
    Download and install the Java Synology package from http://wp.me.//pVshC-z5

    I have installed Java 7 (1.8.0)

    Reply
  3. stephane

    Hi
    I followed all of the instructions, but Bubble doesn’t work at all.
    When i open Bubble app, there is a blank page “page not found”.
    I installed Java,6, 7 and 8 to try different version…
    Thank you for your help

    I have DSM 5 on a synology DS212
    Stephane

    Reply
  4. patters Post author

    I believe I have just added support for the DS414j (new CPU arch: Mindspeed Comcerto 2000) but I have done this without testing since I don’t have one. Can someone please report back here if you can install Java? I will also release Serviio for DS414j soon.

    Reply
  5. MikeB

    Anyone else having issues with downloading the JRE from Oracle? The latest version is downloading fine, but the second to last one (7u55) is not downloading.

    Reply
  6. MMD

    Thanks for quick reply.
    Cannot find 7u55 anymore on the Oracle site.
    Tried to install 7u60 by renaming the file, no luck.
    It says it`s running but cannot start Minecraft.
    Do you know where to download 7u55 as i cannot find it.
    Thanks in advance.

    Reply
      1. litris

        Where can I download the version of java-ejre-7u55-fcs-b13-linux-arm-sflt-headless-17_mar_2014.tar.gz?

        Oracle link does not work and is not downloadable from the official website and the 7u60 doesn’t work.

        Thanks.

      2. patters Post author

        I have the same CPU in my NAS (1.6GHz instead of 2.0GHz in yours). I just removed and reinstalled the package from the repo. It’s working fine so you maybe have some kind of bad download from Oracle. Delete your existing Java file from the public share. Now try to install the package without the .tar.gz file in public. It will fail, but it will tell you precisely which file you need to download from Oracle. Use Firefox to do this, just to be absolutely sure. It’s the only browser that doesn’t try to unpack or rename .tar.gz files. Then report back here please.

  7. derkuechenmeister

    Apparently, there is a new version of the JRE7 available (07_may_2014 instead of 17_mar_2014). Could you update the package please? Furthermore, why are you using the soft-FP version for the DS214+/ArmadaXP instead of hard-FP?

    Thanks for the great work!

    Reply
    1. patters Post author

      I have updated the Java 7 package to support update 60. In testing with Armada 370 the HardFP ABI version didn’t work IIRC. I use the SoftFP ABI (application binary interface). It’s still using the hardware FPU, but the code is compiled in a way that doesn’t break backward compatibility with CPUs with no FPU. See here for an explanation: https://wiki.debian.org/ArmHardFloatPort#ARM_EABI

      Reply
  8. Jorge

    Please, can you confirm that 414j (Mindspeed Comcerto 2000) is supported too?
    I would like to install Serviio.
    Thanks.

    Reply
    1. patters Post author

      I have published the Java package for this CPU but it’s not yet been confirmed working.

      Jorge – can you get Java installed and does it correctly display the version information in the package Log in Package Center? If so I can add support for this model to the other packages like CrashPlan and Serviio. To do this I will need some additonal info from you.

      Please can you post the result from running cat /proc/cpuinfo while connected to your NAS via SSH? Log in as the user root using the same password you defined for the admin account.

      Please also run uname -a and paste the result here. Thanks!

      Reply
  9. Michael

    I have the same problem on my DS414j – eventually got the java runtime to install, rebooted a couple of times but still no sign of CrashPlan! Here are the dumps you requested.
    Not sure it is part of the same issue but Package Centre does not have an “Other Source” menu item or tab…
    Regards
    Michael

    BusyBox v1.16.1 (2014-04-25 21:10:25 CST) built-in shell (ash)
    Enter ‘help’ for a list of built-in commands.

    DS414j…> cat /proc/cpuinfo
    Processor : ARMv7 Processor rev 1 (v7l)
    processor : 0
    BogoMIPS : 2387.14

    processor : 1
    BogoMIPS : 2393.70

    Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant : 0x2
    CPU part : 0xc09
    CPU revision : 1

    Hardware : Comcerto 2000 EVM
    Revision : 0001
    Serial : 0000000000000000

    DS414j…> uname -a
    Linux DS414j… 3.2.40 #4482 SMP Fri Apr 25 20:46:55 CST 2014 armv7l GNU/Linux synology_comcerto2k_ds414j

    Reply
    1. Michael

      You mention in the notes the following:
      The package downloads the CrashPlan installer directly from Code 42 Software, following acceptance of their EULA. I am complying with their wish that no one redistributes it.
      CrashPlan is installed in headless mode – backup engine only. This is configured by a desktop client, but operates independently of it.

      Per my post i cannot finf crashplan on the DS414j at all.
      I have followed the steps and have a correctly installed Java runtime but no crashplan…

      Michael

      Reply
      1. patters Post author

        Can you confirm the Java package Log shows the version number and HotSpot VM version? Once that’s confirmed I can add support for DS414j to the CrashPlan package.

      2. Michael

        Java runtime environment: I confirm Version 1.7.0_60-0025 installed on volume 1
        Unfortunately HotSpot VM has got me stumped! Where do i find that?

        Michael

    2. Michael

      putty ssh
      login as admin
      /volume1/homes/admin $ java -version
      sh: java: not found

      = total frustration
      i have tried umpteen different options to try and return the version even pathing to the install folder
      no luck

      Reply
  10. Jorge

    Hi. I’m a newbie but I’ll try to do it. I’m following the instructions one by one. Which Java SE for Embedded 7 version should I download from Oracle for my 414j?:
    ARMv6/7 Linux – Headless – Client Compiler EABI, VFP, HardFP ABI, Little Endian1
    ARMv6/7 Linux – Headful EABI, VFP, HardFP ABI, Little Endian1
    ARMv7 Linux – Headless – Server Compiler EABI, VFP, HardFP ABI, Little Endian1
    ARMv6/7 Linux – Headless – Client Compiler EABI, VFP, SoftFP ABI, Little Endian2
    ARMv6/7 Linux – Headful EABI, VFP, SoftFP ABI, Little Endian2
    ARMv7 Linux – Headless – Server Compiler EABI, VFP, SoftFP ABI, Little Endian2
    ARMv5 Linux – Headless EABI, SoftFP ABI, Little Endian3

    Reply
  11. Jorge

    Ok. Finally I’ve download this one:
    ARMv6/7 Linux – Headless – Client Compiler EABI, VFP, SoftFP ABI, Little Endian2 31 MB Downloadejre-7u60-fcs-b19-linux-arm-vfp-sflt-client_headless-07_may_2014.tar.gz

    Then I’ve installed “Java SE for Embedded 7″ package from your repository without problems. Once finished I go to “Installed” (packages) and I see Java SE Embedded 7 and its information. It looks ok.

    ————————————-
    cat /proc/cpuinfo
    ————————————-
    Processor : ARMv7 Processor rev 1 (v7l)
    processor : 0
    BogoMIPS : 2387.14

    processor : 1
    BogoMIPS : 2393.70

    Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant : 0x2
    CPU part : 0xc09
    CPU revision : 1

    Hardware : Comcerto 2000 EVM
    Revision : 0001
    Serial : 0000000000000000

    ————————————-
    uname -a
    ————————————-
    Linux DiskStation 3.2.40 #4482 SMP Fri Apr 25 20:46:55 CST 2014 armv7l GNU/Linux synology_comcerto2k_ds414j

    Hope this helps.

    Reply
    1. patters Post author

      Thanks Jorge, that’s perfect. I’ve nearly completed a new Serviio package and that will allow me to add some detection in for that processor. I have built an optimized compile of FFmpeg since that processor has a NEON vector unit, so it should perform better than the other ARMv7l systems.

      If you type java -version do you see this:
      ~$ java -version
      java version "1.7.0_60"
      Java(TM) SE Embedded Runtime Environment (build 1.7.0_60-b19, headless)
      Java HotSpot(TM) Embedded Client VM (build 24.60-b09, mixed mode)

      Reply
      1. patters Post author

        You need to have logged in via SSH since you installed the java package.

        Is it definitely showing as installed in Package Centre? What does the package log say?

  12. Jorge

    Can you please send me an email? I think it’s going to be easier by mail…
    I will send you some screen captures.

    Reply
  13. litris

    Today I have updated the NAS and I had to reinstall the java package.

    I checked the path entries in the profile is deleted.

    Can be arranged so that it will not occur in the next update?

    Thank you.

    Reply
    1. patters Post author

      It does not delete the PATH variable from the profile. It removes the second PATH modify statement that this package makes. If you want to add your own entries to the PATH, then you should instead edit the first PATH= statement, not the one that shows PATH=$PATH:/volume1/@appstore/java7/jre/bin

      Reply
      1. litris

        When the update is installed DSM deletes the entries made in root / .profile

        These lines.
        PATH=$PATH:/volume1/@appstore/java7/jre/bin TZ=Europe/Brussels export JAVA_HOME LANG PATH TZ

  14. litris

    These lines.
    PATH=$PATH:/volume1/@appstore/java7/jre/bin
    TZ=Europe/Brussels
    export JAVA_HOME LANG PATH TZ

    And lines bootstrap opt/bin etc etc ;-)

    Reply
  15. Tommy

    Great job on the java package. Is it possible to get the non-embedded 64-bit java to run on DSM because the embedded java appears to be 32-bit only and limits the heap size to 4 GB at most. I currently have 4.5 TB of data to be backed up (with more to come) and Crashplan recommends 1GB heap memory per TB of data. I’m running DSM on an HP N54L micro server with 16GB RAM (upgraded specifically for Crashplan) and 11GB usable storage space. Crashplan is working fine so far with 2GB java heap memory but it’s only backed up 1.5 TB so far.

    Reply
  16. Chris Powers

    I unfortunately lost a drive about a month ago and was semi-successful in getting Crashplan back on the DS712+.

    However, just looked and saw it had stopped.

    Tried to restart and no dice. In my troubleshooting, decided to try to uninstall Crashplan and reinstall. However, I cannot get Crashplan to install.

    The download looks fine, it goes to install but states I do not have Java installed or configured.

    I’ve got your Java SE Embedded 6 / 1.6.0_38-0023. Do I need to go to a different one? Guessing it’s just a simple as uninstall / reinstall Java, but wanted to double-check first.

    Thanks in advance for the assist.
    -Chris

    Reply
  17. Mark

    I need the java file ejre-1_6_0_38 intel version but it’s not on oracles website. There link is broken. Any ideas where I can get the file from?

    Reply
  18. patters Post author

    I have updated the package so it repairs the environment variables if a DSM update removes them. Can someone with a DS414j please allow me remote access to their NAS so I can get Java working on these systems? I don’t have a test model.

    Reply
    1. Jason

      Do you still need remote access to a DS414J, to get Crashplan working and tested? I have one that I want to get setup and would be willing to give you temp remote access.

      Reply
  19. litris

    I have installed your package with java 7u60 but it tells me that there is a new update of it Pack java7

    And I have to uninstall the old version.

    If I have it installed and there is a version more than java is it necessary to upgrade your package?

    Thank you.

    Reply
  20. scuba

    First, thank you for supporting the community. You’re awesome.

    After updating to “DSM 5.0-4493 Update 2″ on my DS213+, I noticed my Crashplan was not working. All has been well up to this point, and I have about 1TB backed up. So I:

    – Uninstalled Java SE
    – Uninstalled Crashplan

    Now when I attempt to install either Java 7 or Java 8, the installation works but there is no RUN option in the package center, just UNINSTALL. I’m ssh’d in and this is what I see:

    —————————————————————————————
    BusyBox v1.16.1 (2014-05-29 11:26:15 CST) built-in shell (ash)
    Enter ‘help’ for a list of built-in commands.

    ~ # java
    ash: java: not found
    ~ # whoami
    root
    ~ # uname -a
    Linux Netshare 2.6.32.12 #4493 SMP Thu May 29 11:05:51 CST 2014 ppc GNU/Linux synology_qoriq_213+
    ~ # export | grep -i java
    export JAVA_HOME=”
    ~ # java
    ash: java: not found
    ~ # ls -al /volume1/public/
    drwxrwxrwx 4 root root 4096 Jun 29 01:15 .
    drwxr-xr-x 19 root root 4096 Jun 29 00:30 ..
    drwxrwxrwx 2 root users 4096 Sep 13 2013 @eaDir
    -rw-r–r– 1 root root 5307 Mar 20 2012 ejdk-8-fcs-b132-linux-ppc-e500v2-03_mar_2014.tar.gz
    -rw-r–r– 1 root root 5307 Mar 20 2012 ejre-7u60-fcs-b19-linux-ppc-e500v2-headless-07_may_2014.tar.gz
    drwxr-xr-x 3 root root 4096 Aug 18 2013 serviio
    ~ #
    —————————————————————————————

    I have both the Java SE 7 and 8 tars in place. Did update 2 break my ability to install Java, or is something else going on?

    Thanks

    Reply
    1. patters Post author

      There hasn’t been a Run option for many versions now (to mimic Synology’s Perl package for instance, since Java does not run continuously). Remember that if you were connected via SSH before the package was installed and started, you would need to quit and restart your session to pick up the new environment variables – or run:
      source /etc/profile
      source ~/.profile

      What is the status in Package Centre? Running or Stopped?

      Reply
      1. scuba

        No luck with source’ing, re-ssh’ing in. Package Center only option is uninstall. Status is STOPPED. Log says:
        ————————————————————-
        /var/packages/java7/scripts/start-stop-status: /var/packages/java7/scripts/start-stop-status.sh:

        System installed locales:
        C
        cs_CZ.utf8

        en_US.utf8

        JAVA_HOME=
        TZ=US/Pacific
        ————————————————————-

        I’ve tried adding debug to installer.sh, but I am not sure how the package installation calls your scripts. I’ve edited installer.sh to force SYNOPKG_PKGNAME to java8, and that got thru more of the script, but nothing is executed past the source /etc/profile.

        :(

    2. Compuwiz

      I have a similar scenario. Updated to same DSM 5.0-4493 Update 2, uninstalled Java and uninstalled Crashplan, installed Java 7, installed Crashplan. Java shows “Running” for me, but I cannot get Crashplan to start. It says “Started” and then promptly returns back to “Stopped.”
      I don’t know how to do all that fancy SSH stuff, so not sure how to provide logs like Scuba did.

      Reply
  21. litris

    I uninstalled the previous version and I installed the new version with the same java 7.

    Java runs but to Minecraft stopped working I’ve uninstalled and re installed and has not executed.

    Neither your Craftbukkit package.

    No starts.

    Do you know the problem? worked fine before installing the new version of its package of java.

    Thank you.

    Reply
      1. patters Post author

        I also have a Marvell Kirkwood and I don’t have this issue. Is your NAS bootstrapped? Mine is not so I think that can be the only explanation. Let me know – it’s possible the version of sed that ends up higher in the path after bootstrapping has slightly different syntax.

      2. litris

        Solved! But I can not say exactly what was the failure to I made two changes.

        1. Since I had export “LC_ALL = es_ES.utf8″ and I put as export “LC_ALL = en_US.utf8″

        2. The first line you write your java package is “PATH=$PATH:/volume1/@appstore/java7/jre/bin # Synology Java Package” instead of the beginning of the last line was really the last.

        The latter is no fault if your package installation or editing mia doing tests with “config file editor”

        Thanks.

  22. litris

    Everything worked fine.

    I just uninstalled the old version of your package to update the new what the message said “before upgrading uninstall previous version”

    And it works if I put Java in the Java version had me indicates that this well.

    Reply
  23. Jacques Chatenay

    Hello I tried to install Java SE Embedded 8 using your Installer but it tells me I have the wrong file I can not find the file it is asking for on the oracle site I can only find ejdk-8u6-fcs-b23-linux-i586-12_jun_2014.tar.gz would it be safe to simply rename the file to the name it is locking for ? For now I installed ejre-7u60-fcs-b19-linux-i586-headless-07_may_2014.tar.gz will it be OK to install V 8 over the top of V7 when you get this fixed or will I need to uninstall and start over ?

    Reply
      1. patters Post author

        The package will not let you. You need to stop any packages using Java, then uninstall the old version first.

      2. Jacques Chatenay

        Again, Thank you as you have probably already guessed, I am a complete novice when it comes to Linux. Is there anything special I need to do to uninstall or just stop my crash plan go to your package uninstall and then install the new version and then restart crash plan?

  24. Romme

    Have added the package repository URL to my DS509+, but no packaged for java are available in the package center.

    Reply
  25. Compuwiz

    Hi Patters,
    I just updated my DS411+II to the latest DSM version (5.0-4493 Update 2). I also was notified that I needed to update my Java. I stopped my CrashPlan, uninstalled Java, downloaded/transferred the specified Java 7 headless file and re-installed Java w/no problems. I went to re-install CrashPlan (successful), but when I go to Start, it says “Started” but then promptly goes back to “Stopped” status.
    I noticed that when CrashPlan was uninstalled it removed the Crasplan user, and when reinstalled, it re-creates it (without appropriate permissions to the Shares), so I re-added those permissions. But even still, I do not know how to get the Crashplan to stay “Started”.
    Any ideas? Thanks!

    Reply
  26. mohammedslimani

    Hello and thank you for your work :)

    I just installed the latest DSM update (DSM 5.0-4493 update 3) and the latest JAVA8 update. Then I’ve noticed that my crashplan was not working properly anymore. It keept starting and crashing…

    So I uninstalled crashplan and java, I reinstalled Java8 (ejdk-8u6-fcs-b23-linux-i586-12_jun_2014.tar.gz) and tryed to reinstall Crashplan. Java installation is OK but crashplan won”t install, I’m getting an error ‘Invalid file format’.

    Could you help plz?

    DiskCraft> env | grep java
    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/volume1/@appstore/java8/ejdk1.8.0_06/linux_i586/jre/bin
    CLASSPATH=.:/volume1/@appstore/java8/ejdk1.8.0_06/linux_i586/jre/lib
    JAVA_HOME=/volume1/@appstore/java8/ejdk1.8.0_06/linux_i586/jre

    Reply
    1. patters Post author

      I would advise using Java 7 for most things, unless the application you are trying to run explicitly supports version 8.

      Reply
  27. richard clark

    213j NAS Trying to install Java 8. Have registered, copied ejdk-8u6-fcs-b23-linux-arm-sflt-12_jun_2014.tar.gz to /volume1/public, and added http://packages/pcloadletter.co.uk to the package installer. I can SSH as admin and lt shows the package in the correct directory, to which all accounts have R/W access. However when I run the Java SE embedded 8 install, it falis to install with the message “I was expecting the file /volume1/public/ejdk-8u6-fcs-b23-linux-arm-sflt-12_jun_2014.tar.gz etc….
    Any ideas? – thanks for the help in advance.

    Reply
  28. Zino

    struggling to install java embedded on my ds214, tried different versions of java 6, 7, 8 none recognizes the package on the public folder even if the file name is exactly the same as it is asking for. tried with java installer app with the same result. public folder is shared with permissions for all kinds for all users, tried downloading the packages with different browsers, nothing helps… any idea?

    Reply
    1. patters Post author

      Have you tried with Firefox? I think it’s the only browser that leaves the file alone and doesn’t try to rename it or unpack it.

      Reply
  29. uniform

    Hi,
    thank you for your work on this, it’s a great guide.
    I have a fresh Synology EDS14 (Armada 370) which I am trying to get Java 6 or 7 running on using your method, however I am unsuccessful.
    Despite placing the correct files into the correct folder, ensuring the appropriate file permissions, etc I get the error:
    “Operation Failed. I was expecting the file….”.
    I originally attempted this with the EDS14 running DSM 4.3 but then upgraded to DSM 5 with the same results.
    The only other thing I can add is that the EDS14 uses external storage so uses variable volume labels like this:
    “/volumeUSB2/usbshare/@sharebin/public”.
    Despite this, the “Operation Failed” error message tells me it is looking in the correct location for the files.

    Any idea on how to get this to go?

    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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s