JDK-8351369 : [macos] Use --install-dir option with DMG packaging
  • Type: Enhancement
  • Component: tools
  • Sub-Component: jpackage
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: generic
  • Submitted: 2025-03-06
  • Updated: 2025-06-11
  • Resolved: 2025-05-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 25
25 b26Fixed
Related Reports
Relates :  
Description
Currently, jpackage ignores the value of the `--install-dir` option in DMG packaging. This behavior was implemented to fix an issue reported in JDK-8263154.

The issue is that if the path specified in `--install-dir` option doesn't exist on the machine where jpackage is executed, jpackage fails.

The suggested workaround of always using the default installation location ("/Applications") made sense while jpackage didn't support runtime packaging. This is not the case any longer.

For Java runtime packages, the default install location is "/Library/Java/JavaVirtualMachines" which may not exist where jpackage runs.

The suggested solution is to respect the value of the `--install-dir` option. If the installation directory doesn't exist, jpackage should try to create and delete it right after the DMG package is created. If it can't create the directory (likely due to the lack of permissions), it should report an error.

It should also gracefully handle the case when the path referenced in the `--install-dir` option exists but is not a directory.

Comments
Changeset: fd51b039 Branch: master Author: Alexander Matveev <almatvee@openjdk.org> Date: 2025-05-30 03:07:04 +0000 URL: https://git.openjdk.org/jdk/commit/fd51b03910ba90ca1c46a4204b8940421338e22e
30-05-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25481 Date: 2025-05-28 07:11:36 +0000
28-05-2025