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

Alexander Matveev almatvee at openjdk.org
Fri Jan 16 22:45:36 UTC 2026


On Fri, 16 Jan 2026 05:16:19 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

> > Do we want to normalize module version?
> 
> When jpackage derives bundle properties from the input data, it should get the valid values. If it can't do it, it should fail.
> 
> > What possible format for module version?
> 
> No idea. How is it relevant? If jpackage can't get a valid platform-specific bundle version from the module version, it should fail.

Why we need to normalize version then?

> 
> > Having generic normalization for both module, release file or anything else is probably over complicated.
> > It is the opposite: applying the same normalization function to any input is simple. If it can't produce a valid output, stop further processing if there are no other options.
> 
> Besides a command line, jpackage can derive the app version from the main jar, module, and now from the runtime.
> 
> Do you suggest handling these cases differently?

Yes. Lets add corresponding classes to read versions: `RuntimeVersionReader`, `JarVersionReader`, `ModuleVersionReader`. All these classes will return version in following format: N.N.... These classes will be responsible to convert version if needed. For example jar can have: `1.2.3-SNAPSHOT`.  In this case `JarVersionReader` will return `1.2.3` and `WinFromOptions` will normalize it to `1.2.3.0`.

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

PR Comment: https://git.openjdk.org/jdk/pull/29260#issuecomment-3762093253


More information about the core-libs-dev mailing list