Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8199845

JDK installation (RPM) fails while trying to create a symbolic link

XMLWordPrintable

    • x86
    • other

      FULL PRODUCT VERSION :
      Reproduced with the latest version: jdk-9.0.4_linux-x64_bin.rpm
      But also: jdk-8u141-linux-x64.rpm, jdk-8u131-linux-x64.rpm

      ADDITIONAL OS VERSION INFORMATION :
      Docker container containing RHEL 6.4 running on Ubuntu
      Linux 58e76ceac360 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      Goal: install jdk in a non standard path (other than /usr/java).

      Postscript dump: rpm -qp --scripts /tmp/jdk-9.0.4_linux-x64_bin.rpm > postscript.sh
      After examination of the postscript, it appears that the issue come from these lines:
          941 # If the package is being relocated, then create a link in the default
          942 # location (/usr/java) to the actual install directory. Do this
          943 # last, so it doesn't add unnecessary complexity to the search for the
          944 # latest release.
          945 #
          946 if [ "${RPM_INSTALL_PREFIX}" != "/usr/java" ] &&
          947 ( [ ! -e "/usr/java/jdk-9.0.4" ] || [ -h "/usr/java/jdk-9.0.4" ] )
          948 then
          949 rm -f "/usr/java/jdk-9.0.4"
          950 ln -s "${RPM_INSTALL_PREFIX}/jdk-9.0.4" "/usr/java/jdk-9.0.4"
          951 fi

      At the first installation of java on the machine, /usr/java does not exist.
      Creating a directory java in /usr before launching the installation fix the issue.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      # rpm --prefix=/opt/oracle -i /tmp/jdk-9.0.4_linux-x64_bin.rpm

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      # rpm --prefix=/opt/oracle -i /tmp/jdk-9.0.4_linux-x64_bin.rpm
      Unpacking JAR files...
      plugin.jar...
      javaws.jar...
      deploy.jar...
      # echo $?
      0
      ACTUAL -
      # rpm --prefix=/opt/oracle -i /tmp/jdk-9.0.4_linux-x64_bin.rpm
      Unpacking JAR files...
      plugin.jar...
      javaws.jar...
      deploy.jar...
      ln: creating symbolic link `/usr/java/jdk-9.0.4': No such file or directory

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      ln: creating symbolic link `/usr/java/jdk-9.0.4': No such file or directory

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      At the first installation of java on the machine, /usr/java does not exist.
      Creating a directory java in /usr before launching the installation fix the issue.

            asemenyuk Alexey Semenyuk
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: