RFR: 8171508: Remove -Dsun.java.launcher.is_altjvm option [v4]

David Holmes dholmes at openjdk.org
Mon Apr 7 06:08:56 UTC 2025


On Sun, 6 Apr 2025 23:55:01 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> This change fixes two issues in `os::jvm_path()`:
>> 
>> - go back 4 instead of 5 slashes and then checking for "/jre/lib";
>> - fix the hardcoded "hotspot" sub-directory before the jvm library name.
>> 
>> Passed tiers 1 - 3 testing.
>
> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fix issues related to JAVA_HOME and gtest

So basically now we have removed the `-Dsun.java.launcher.is_altjvm` option and replaced its use with gtest by the use of the `executing_unit_tests` functionality. Okay.

A few minor requests. Thanks.

src/hotspot/os/aix/os_aix.cpp line 1309:

> 1307:   assert(rp != nullptr, "error in realpath(): maybe the 'path' argument is too long?");
> 1308: 
> 1309:   if(Arguments::executing_unit_tests()) {

Suggestion:

  if (Arguments::executing_unit_tests()) {

src/hotspot/os/linux/os_linux.cpp line 2775:

> 2773:   }
> 2774: 
> 2775:   if (Arguments::executing_unit_tests()) {

Suggestion:

  // If executing unit tests we require JAVA_HOME to point to the real JDK.
  if (Arguments::executing_unit_tests()) {

src/hotspot/os/linux/os_linux.cpp line 2802:

> 2800:         // Use current module name "libjvm.so"
> 2801:         len = (int)strlen(buf);
> 2802:         snprintf(buf + len, buflen-len, "/%s/libjvm%s",

Suggestion:

        snprintf(buf + len, buflen - len, "/%s/libjvm%s",

src/hotspot/os/linux/os_linux.cpp line 2808:

> 2806:         }
> 2807: 
> 2808:         // determine if this is a legacy image or modules image

Delete the comment on the next line about the jre  subdirectory please.

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

Changes requested by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24310#pullrequestreview-2741876785
PR Review Comment: https://git.openjdk.org/jdk/pull/24310#discussion_r2030459810
PR Review Comment: https://git.openjdk.org/jdk/pull/24310#discussion_r2030453863
PR Review Comment: https://git.openjdk.org/jdk/pull/24310#discussion_r2030458706
PR Review Comment: https://git.openjdk.org/jdk/pull/24310#discussion_r2030456402


More information about the hotspot-runtime-dev mailing list