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

jpackage: Invalid 32-bit exe when building app-image

    XMLWordPrintable

Details

    • b06
    • x86
    • windows
    • Not verified

    Description

      ADDITIONAL SYSTEM INFORMATION :
      JDK 15, 16, 17 with Windows 32-bit

      A DESCRIPTION OF THE PROBLEM :
      The executable produced by jpackage is invalid on Windows 32-bit. It was working with JDK 14.

      Moreover, it does not seem possible to build an installer on windows 32-bit. There is a hardcoded variable that force to build a 64-bit installer. See https://github.com/openjdk/jdk/blob/e3793e5a608fd44ff479734182af20a06eb0ec14/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixPipeline.java#L115

      REGRESSION : Last worked in version 14

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Build TestApp on windows 32-bit and run TestApp.exe

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Launch exe without error
      ACTUAL -
      Popup error dialog: GetPRocAddress ... JLI_Launch failed. System Error 127

      ---------- BEGIN SOURCE ----------
      Test case: https://github.com/nroduit/testApp
      Build script:

      #!/bin/bash

      # change me
      export JAVA_HOME="/home/nicolas/Apps/java/15/jdk-15-ea+36_linux-x64"
      #export JAVA_HOME="/home/nicolas/Apps/java/16/zulu16.0.31-ea-jdk16.0.0-ea.14-linux_x64"
      export PATH="$JAVA_HOME/bin:$PATH"

      NAME="TestApp"
      VENDOR="Team"
      COPYRIGHT="© 2020 Team"

      git clone https://github.com/nroduit/testApp.git
      cd testApp/

      # Get the machine architecture
      arc=$(uname -m)
      case "$arc" in
        x86) arc="x86";;
      i?86) arc="x86";;
      amd64) arc="x86_64";;
      x86_64) arc="x86_64";;
      * ) die "The machine architecture '$arc' -> is not supported.";;
      esac

      # Get the system name
      machine="$(uname -s)"
      case "${machine}" in
        Linux*) machine="linux";;
      Darwin*) machine="macosx";;
      CYGWIN*) machine="windows";;
      *) die "The system '$machine' -> is not supported.";;
      esac

      # Build App
      mvn -B package --file pom.xml
      cp target/app.jar ./


      rm -rf ./dist

      jpackage --type app-image -p "./" -m app/org.test.TestApp --dest "dist/image" --name "${NAME}" --java-options "-splash:\$APPDIR\splash.jpg" --verbose
      if [ "$machine" = "macosx" ] ; then
         OUT_APP="dist/image/${NAME}.app/Contents/app"
      elif [ "$machine" = "windows" ] ; then
         OUT_APP="dist/image/${NAME}/app"
      else
         OUT_APP="dist/image/${NAME}/lib/app"
      fi
      cp splash.jpg "${OUT_APP}"

      if [ "$machine" = "windows" ] ; then
        [ "$arc" = "x86" ] && UPGRADE_UID="3aedc24e-48a8-4623-ab39-0c3c01c7383b" || UPGRADE_UID="3aedc24e-48a8-4623-ab39-0c3c01c7383a"
        jpackage --type "msi" --app-image "dist/image" --dest "dist" --name "$NAME" \
        --description "Test App" --win-upgrade-uuid "$UPGRADE_UID" --copyright "$COPYRIGHT" --vendor "$VENDOR" --verbose
      elif [ "$machine" = "linux" ] ; then
        declare -a installerTypes=("deb" "rpm")
        for installerType in ${installerTypes[@]}; do
         jpackage --type "$installerType" --app-image "dist/image" --dest "dist" --name "$NAME" \
         --description "Test App" --copyright "$COPYRIGHT" --vendor "$VENDOR" \
         --resource-dir "resources" --linux-app-release "1" --linux-package-name "app" --linux-deb-maintainer "unknown" --linux-rpm-license-type "EPL-2.0" \
         --linux-menu-group "Viewer;Graphics;" --linux-app-category "science" --linux-shortcut --verbose
        done
      elif [ "$machine" = "macosx" ] ; then
         jpackage --type "pkg" --app-image "dist/image" --dest "dist" --name "$NAME" \
         --copyright "$COPYRIGHT" --mac-package-identifier "org.test" --verbose
      fi
      ---------- END SOURCE ----------

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              herrick Andy Herrick (Inactive)
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: