RFR: 8357404: jpackage should attempt to get a package version from the JDK's release file if the --version option is not specified [v6]

Alexey Semenyuk asemenyuk at openjdk.org
Wed Feb 4 03:51:15 UTC 2026


On Wed, 4 Feb 2026 00:25:16 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:

>> src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/RuntimeImageUtils.java line 47:
>> 
>>> 45:         }
>>> 46: 
>>> 47:         return releaseFile;
>> 
>> Why do we need platform-specificity in this function?
>> 
>> Shouldn't it be as simple as:
>> 
>> public static Path getReleaseFilePath(Path runtimePath) {
>>     return runtimePath.resolve("release");
>> }
>
> This function is being called 3 times already. I think having platform specific code in it is better, then duplicating:
> 
> RuntimeImageUtils.getReleaseFilePath(MacBundle.fromPath(cookedRuntime).map(MacBundle::homeDir).orElse(cookedRuntime));
> 
> I do like idea of using `MacBundle.fromPath()`.

The code that finds the JDK image directory in a random path is a separate function.
The function that returns a path to the "release" file in the JDK image should take a path to the JDK image directory.

If we need a convenience function that does both things, we should implement it on top of these two functions.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29260#discussion_r2762031458


More information about the core-libs-dev mailing list