RFR: 7904084: Unset javaOpts and jtregOpts in jtreg.sh [v2]
SendaoYan
syan at openjdk.org
Tue Dec 2 12:32:30 UTC 2025
On Tue, 2 Dec 2025 12:01:02 GMT, Christian Stein <cstein at openjdk.org> wrote:
> Did you see an error when used in combination with another or the same script? If yes, which one(s)?
Below command shows this error:
> jtreg -version
jtreg 8.1-dev+0
Installed in /home/yansendao/JDK/tools/jtreg/jtreg-8.1/lib/jtreg.jar
Running on platform version 25.0.1-internal from /home/yansendao/JDK/binary/openjdk/jdk25u.
Built with Java(TM) 2 SDK, Version 25.0.1-internal-987af5af on October 10, 2025.
JT Harness, version 6.0 ea b24 (October 10, 2025)
Java Assembler Tools, version 8.1 ea 01 (October 10, 2025)
TestNG: testng-7.3.0.jar, guice-5.1.0.jar, jcommander-1.82.jar
JUnit: junit-platform-console-standalone-1.13.4.jar
> jtregOpts="ValuesBeforeStartJtreg" jtreg -version
Error: Cannot find file: ValuesBeforeStartJtreg
> There's related prior-art in the script for the `DUALCASE` variable. Which is declard and initialized before each use, and `unset` after each use. Would it be possible to the same for `javaOpts` and `jtregOpts`? Or at least `unset` both after use.
I think `unset javaOpts` is identical to `javaOpts=""`
> Another solution would be to introduce script-`local` variables, right?
`local` illegal outside shell function.
-------------
PR Comment: https://git.openjdk.org/jtreg/pull/291#issuecomment-3601797729
More information about the jtreg-dev
mailing list