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

Should not default class path to CWD if -cp is not specified but -m is specified

    XMLWordPrintable

Details

    Description

      $ java Hi

      classpath has always been default to PWD.

      With modules:
      $ java -p mods -m m1/p.Hi

      -classpath option and CLASSPATH environment variable are not set. The current implementation defauts class path to PWD. In other words, the builtin application class loader will search classes from PWD.

      The VM always sets "java.class.path" to an empty string for the following cases
      1. -Djava.class.path is not set
      2. -Djava.class.path is set to no value (without = sign)
      3. -Djava.class.path= explicitly set to empty value

      Automatic modules are used to bridge to the class path and it might expect that $PWD is the class path.

      Attachments

        Issue Links

          Activity

            People

              mchung Mandy Chung
              mchung Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: