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

Image created with jlink can't find dynamic libraries on Linux

XMLWordPrintable

    • x86
    • linux

      ADDITIONAL SYSTEM INFORMATION :
      CentOS 6.10 64-bits, Oracle OpenJDK 11.0.2

      A DESCRIPTION OF THE PROBLEM :
      I have compiled a modular application on Windows 10 using Java SE 11.0.2. I have downloaded the Linux 64-bits jmods and I have used them to create a run-time image. I have copied the image to a CentOS 6.10 64-bits VM where there was no Java installed. When I launch the java executable it fails saying "Error: could not find libjava.so". The libjava.so file is in the lib folder of the run-time image. If I move the java executable to /usr/bin and the libjava.so to /usr/lib, it complains about not finding a different .so file, so I guess this means that it expects to find the contents of the lib folder in the /usr/lib directory. On Windows there is no such problem (i.e. if I create an image using the Windows jmod files, the java executable starts without problems). This behaviour defeats the purpose of creating a self-contained image

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1 - Create a modular application using Oracle OpenJDK 11.0.2
      2 - Compile it on Windows 10
      3 - Download the Oracle OpenJDK 11.0.2 Linux 64-bits jmods
      4 - Use the Linux jmods to create a run-time image with jlink
      5 - copy the image to a CentOS 6.10 64-bits VM
      6 - run the application (or simply execute java -version)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Java starts
      ACTUAL -
      Java does not start, the error is "Error: could not find libjava.so"

      FREQUENCY : always


            pmangal Priyanka Mangal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: