Skip to content

[native-image --version] No way to tell version in use when JDK isn't jlinked nor compiled to binary #6319

@jerboaa

Description

@jerboaa

Describe the issue
After #6302 there is no way for us (Mandrel) to tell which codeline is in use based on the native-image --version output. We use the bash launcher (deliberately) and don't jlink the base JDK that is in use (plain OpenJDK).

java.vendor.version is a protected property, which cannot be set on the command line:

$ java -Djava.vendor.version=foo -XshowSettings:properties --version 2>&1 | grep vendor
    java.specification.vendor = Oracle Corporation
    java.vendor = Red Hat, Inc.
    java.vendor.url = https://www.redhat.com/
    java.vendor.url.bug = https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=java-17-openjdk&version=37
    java.vendor.version = (Red_Hat-17.0.6.0.10-1.fc37)
    java.vm.specification.vendor = Oracle Corporation
    java.vm.vendor = Red Hat, Inc.

That means, the new native-image --version output solely contains JDK version properties, which is unfortunate since we cannot tell which code line is in use (23.x or 24.x or...).

Example (of a recent mandrel build from graal master):

$ native-image --version
native-image 20.0.1-internal 2023-04-18
OpenJDK Runtime Environment null (build 20.0.1-internal-adhoc.sgehwolf.jdk20u)
OpenJDK 64-Bit Server VM null (build 20.0.1-internal-adhoc.sgehwolf.jdk20u, mixed mode)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions