4.1. My test only passes if I don't use jtreg to run it. Why does it fail in jtreg?

By default, tests run using jtreg are each run in a separate JVM. By design, only a limited number of shell environment variables are passed down to the test's JVM. This may affect how a test is run.

As per spec, the only shell environment variables that are automatically propagated into the test's JVM are:

If your test needs to provide more environment variables or to override any values, use the -e option.