Menu

#563 Areca fails to launch with OpenJDK 8

areca-7.x
open
nobody
None
1
2017-11-26
2014-12-08
Simpleton
No

After upgrading from Fedora 20 to 21, I discovered that Areca no longer starts. Apparently, this is due to the different strings with which OpenJDK identifies itself when running java -version.

OpenJDK 7 in Fedora 20:

java version "1.7.0_71"
OpenJDK Runtime Environment (fedora-2.5.3.0.fc20-i386 u71-b14)
OpenJDK Client VM (build 24.65-b04, mixed mode, sharing)

OpenJDK 8 in Fedora 21:

openjdk version "1.8.0_25"
OpenJDK Runtime Environment (build 1.8.0_25-b18)
OpenJDK 64-Bit Server VM (build 25.25-b02, mixed mode)

As far as I can tell, the problem is caused by check_version() in areca_run.sh checking if the first line of the above output starts with "java". Replacing

if [ "$JAVA_IMPL" = "java" ] ; then

with

if [[ "$JAVA_IMPL" = "java" || "$JAVA_IMPL" = "openjdk" ]] ; then

worked around this issue for me.

Discussion

  • André

    André - 2014-12-29

    I can confirm, what user Simpleton said. I tried Areca under Fedora 21 for the first time and got the output
    "ls: Zugriff auf /usr/java nicht möglich: Datei oder Verzeichnis nicht gefunden
    No valid JRE found in /usr/java."

    Then I changed the line in /areca/bin/areca_run.sh like user Simpleton pointed out ... and then Areca starts fine.

     
  • bernd_b

    bernd_b - 2015-04-11

    Same here on archlinux 64bit.

     
  • Stefan Willinger

    Same here on Fedora 22.
    But in my opinon, the proposed solution is not correct. OpenJDK, reports the version as openjdk version "1.8.0_51". So the sed command does not work and the version check is useless.

    For OpenJDK, the following will work correctly.

    #Method to check the current JRE (>=1.4)
    check_version() {
      JAVA_HEADER=`${JAVA_PROGRAM_DIR}java -version 2>&1 | head -n 1`
      JAVA_IMPL=`echo ${JAVA_HEADER} | cut -f1 -d' '`
      if [[ "$JAVA_IMPL" = "java" || "$JAVA_IMPL" = "openjdk" ]] ; then
        VERSION=`echo ${JAVA_HEADER} | sed "s/^.* version \"\(.*\)\".*$/\1/"`
        if echo $VERSION | grep "^1.[0-3]" ; then
          return 1
        else
          return 0
        fi
        else
        return 1
      fi
    }
    
     
  • Lane Lester

    Lane Lester - 2016-11-28

    Simpleton's fix worked for me in Linux Mint/KDE. I had to make a symlink from /usr/lib/jvm/java-9-openjdk-amd64 to /usr/Java.

    Lane

     
  • Ahmed Rashed

    Ahmed Rashed - 2017-11-26

    I found this replacement file solve the problem https://gist.github.com/JesterEE/1658b83fe3536d6e06a0.

    But I'm really disappointed that this bug was not solved since 2015. I began to think that areca is dead with no recent development.

     

Log in to post a comment.