JDK-8227529 : With malformed --app-image the error messages are awful
  • Type: Bug
  • Component: tools
  • Sub-Component: jpackage
  • Affected Version: 21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-07-10
  • Updated: 2025-01-16
  • Resolved: 2023-12-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21 JDK 22
21.0.7-oracleFixed 22 b27Fixed
Related Reports
Duplicate :  
Relates :  
Description
jpackage --app-image /tmp does not provide a helpful message with a malformed app-image.

Example 1:
 jpackage --app-image /tmp --package-type deb  --output x

Output:
Bundler DEB Installer skipped because of a configuration problem: java.lang.NullPointerException.

Example 2:
jpackage --app-image /tmp

Output:
Error: Option [--app-image] is not valid with package-type [null].

Example 3:
mkdir /tmp/x
touch /tmp/x/y
jpackage --app-image /tmp/x --package-type deb  --output x --name xxxx

Output 3:
java.nio.file.NoSuchFileException: /tmp/jdk.jpackage13842042862336393495/images/linux-deb.image/xxxx-1.0/opt/xxxx/bin/xxxx.png

Example 4:  (Even with a well formed app image) if the --name is missing the message is poor.
jpackage -o out --app-image out/skara --package-type deb

Output 4:
Bundler DEB Installer skipped because of a configuration problem: java.lang.NullPointerException.


Comments
Fix request [21u] I backport this for parity with 21.0.7-oracle. No risk, only a test change Clean backport. Test passes. SAP nightly testing passed.
14-01-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/1320 Date: 2025-01-13 08:04:03 +0000
13-01-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/16901 Date: 2023-11-30 14:14:56 +0000
09-11-2024

Changeset: 56d4c33f Author: Alexey Semenyuk <asemenyuk@openjdk.org> Date: 2023-12-01 01:53:20 +0000 URL: https://git.openjdk.org/jdk/commit/56d4c33f4096d98d08eba870070b5f21125f80be
01-12-2023

Handling of invalid app image dir contents was improved in JDK-8287971
29-11-2023

JDK22 jpackage handles described use cases better: ~$ ./jdk-22/bin/jpackage --app-image /tmp --type deb --dest x Error: Missing .jpackage.xml file in app-image dir "/tmp" ~$ ./jdk-22/bin/jpackage --app-image /tmp Error: Missing .jpackage.xml file in app-image dir "/tmp" ~$ mkdir /tmp/x; touch /tmp/x/y ~$ ./jdk-22/bin/jpackage --app-image /tmp/x --type deb --dest x --name foo Error: Missing .jpackage.xml file in app-image dir "/tmp/x" ~$ ./jdk-22/bin/jpackage --app-image /tmp/x2 --type deb --dest x --name foo Error: App image directory "/tmp/x2" does not exist Still, makes sense to add relevant tests.
29-11-2023