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

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

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 13
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: