JDK-8284973 : jpackage throws NPE if it can't figure out package name from app image
  • Type: Bug
  • Component: tools
  • Sub-Component: jpackage
  • Affected Version: 18,19
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2022-04-18
  • Updated: 2023-11-30
  • Resolved: 2023-11-30
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 22
22Resolved
Related Reports
Duplicate :  
Relates :  
Description
When jpackage is used to create a package from external app image that doesn't have app name saved, jpackage throws NPE:
[08:41:58.723] java.lang.NullPointerException: Cannot invoke
"java.lang.CharSequence.length()" because "this.text" is null 
         at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1769)
         at java.base/java.util.regex.Matcher.reset(Matcher.java:415)
         at java.base/java.util.regex.Matcher.<init>(Matcher.java:252)
         at java.base/java.util.regex.Pattern.matcher(Pattern.java:1144)
         at jdk.jpackage/jdk.jpackage.internal.LinuxDebBundler.lambda$static$1(LinuxDebBundler.java:84)
         at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.validate(LinuxPackageBundler.java:72)
         at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:688)
         at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:561)
         at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
         at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52) 

jpackage must report an error with the hint that app image is missing  .jpackage.xml file in the given image instead.

Follow https://mail.openjdk.java.net/pipermail/core-libs-dev/2022-April/087851.html for more details.
Comments
Dup of JDK-8227529. Same root cause, the same resolution
30-11-2023

Handling of missing .jpackage.xml in app image dir was implemented in JDK-8287971 fix
29-11-2023