Access ${TESTCLASSES} on @run?

Weijun Wang at
Tue Nov 13 16:54:07 PST 2012

Is there a way to access the $TESTCLASSES env variable on @run?

I am writing a test that would need to prepend a class path to 
bootclasspath. Currently I have to use a shell script:

    $TESTJAVA/bin/javac -d . \
         ${TESTSRC}/ ${TESTSRC}/
    $TESTJAVA/bin/java -Xbootclasspath/p:. DNS

It will be nice if I can only write

  * @build NamingManager
  * @run main/othervm -Xbootclasspath/p:$TESTCLASSES DNS

I know I can move the classes from TESTCLASSES to pwd by adding a line 
at the top of the test:

   Files.move(Paths.get(System.getProperty("test.classes") + "/javax"), 

so that the test can be executed with

  * @run main/othervm -Xbootclasspath/p:. DNS

but that's really ugly.


More information about the jtreg-use mailing list