RFR: 8340114: Remove outdated SelectVersion() function from the launcher and update the code comments explaining the code flow [v6]

Jaikiran Pai jpai at openjdk.org
Tue Sep 17 11:32:04 UTC 2024


On Tue, 17 Sep 2024 11:09:03 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Now that you mention it, one part of the changes in this PR, moves the checks and error reporting for the -version:, -jre-restrict-search and -jre-no-restrict-search options to the ParseArguments function. I think we can just get rid of that code and let those options be considered as just another unknown option to the launcher.

I've now updated the PR to consider these 3 options just like any other unknown option. The previous existing `MultipleJRERemoved` is no longer needed and that's been removed too.

> I can open a CSR linked to this current PR to formalize that change. 

Thinking more, I don't think a CSR is needed here. In the current mainline, even without these proposed changes, if I launch `java` with either of these 3 options then the launch fails with an error:


java -jre-no-restrict-search Foo             
Error: Specifying an alternate JDK/JRE is no longer supported.
  The related flags -jre-restrict-search | -jre-no-restrict-search are also no longer valid.
Error: Specifying an alternate JDK/JRE is no longer supported.
  The related flags -jre-restrict-search | -jre-no-restrict-search are also no longer valid.
Unrecognized option: -jre-no-restrict-search
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


With the latest proposed change in this PR, the java launch with continue to fail with a (generic) error:


Unrecognized option: -jre-no-restrict-search
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


So I don't think this deserves a CSR.

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

PR Comment: https://git.openjdk.org/jdk/pull/20997#issuecomment-2355425729


More information about the core-libs-dev mailing list