The cases are as follows:
1.) app-image is created:
1.1) created by jpackage using explicit "--name" argument
1.2) created by jpackage using the default name derived from the main class name.
1.3) "foreign" app-image. (a non-jpackaged bundle from which jpackage can create an installer
2.) installer is created using jpackage "--app-image" argument.
2.1) with explicit --name argument
2.2.1) with --name argument matching the name in 1.1 or 1.2
2.2.2) with --name argument not matching the app name from 1.1 or 1.2
2.3) with no explicit --name argument is used
The only case that should be an error is (1.3, 2.3} - name must come from somewhere.
The current code works well in all these cases except the following:
A) The install dir on linux and windows is based on the name. The name used in cases 2.2.2 is the installer name instead of the application name.
B) In case 2.3, a miss-leading error is thrown from LauncherData.createNonModular() saying there is no main jar. (LauncherData should not be created from params when --app-image is used, the name should be derived from the app-image)
In general, if --app-image argument is used, the application name should be derived from the app-image, and any --name argument should only be used as the name of the installer. If there is no --name argument, then name of the installer should be derived from the app-image. If the name cannot be derived from the app-image (foreign app-image) then the given --name should be used, and only then if there is no --name argument should there be an error.
1.) app-image is created:
1.1) created by jpackage using explicit "--name" argument
1.2) created by jpackage using the default name derived from the main class name.
1.3) "foreign" app-image. (a non-jpackaged bundle from which jpackage can create an installer
2.) installer is created using jpackage "--app-image" argument.
2.1) with explicit --name argument
2.2.1) with --name argument matching the name in 1.1 or 1.2
2.2.2) with --name argument not matching the app name from 1.1 or 1.2
2.3) with no explicit --name argument is used
The only case that should be an error is (1.3, 2.3} - name must come from somewhere.
The current code works well in all these cases except the following:
A) The install dir on linux and windows is based on the name. The name used in cases 2.2.2 is the installer name instead of the application name.
B) In case 2.3, a miss-leading error is thrown from LauncherData.createNonModular() saying there is no main jar. (LauncherData should not be created from params when --app-image is used, the name should be derived from the app-image)
In general, if --app-image argument is used, the application name should be derived from the app-image, and any --name argument should only be used as the name of the installer. If there is no --name argument, then name of the installer should be derived from the app-image. If the name cannot be derived from the app-image (foreign app-image) then the given --name should be used, and only then if there is no --name argument should there be an error.
- duplicates
-
JDK-8255055 Create two phase test for case with different names, and fix linux DTI
-
- Closed
-
- relates to
-
JDK-8254783 jpackage fails on Windows when application name differs from installer name
-
- Resolved
-