Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8218029

[TESTBUG] Use -Djava.class.path= to specify empty -cp in CDS tests

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 13
    • None
    • hotspot
    • b07

    Description

      Some CDS tests need to start a JVM process with an empty classpath. However, ProcessTools would always add "-cp" to the command-line

      http://hg.openjdk.java.net/jdk/jdk/file/1ec56532ae0c/test/lib/jdk/test/lib/process/ProcessTools.java#l288

      When running jtreg, the above line will always add a non-empty classpath to the JVM process's command-line.

      To counteract this, the CDS tests would add this to the command-line arguments:

                  "-cp", "\"\"",

      However, while this would set the -cp to the empty string on Windows, on other platforms, the -cp ends up being a string with 2 double-quote characters.

      The portable way to specify an empty -cp is to add the following to the command-line:

             "-Djava.class.path="

      Attachments

        Activity

          People

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: