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

Quoting of the class path inside an argument file doesn't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 14, 15
    • tools
    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      openjdk full version "14+36-1461"

      A DESCRIPTION OF THE PROBLEM :
      When quoting the class path inside an argument file, the class path doesn't seem to be parsed correctly, and the main class isn't found

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      In any folder X:
      * create a subfolder "test", which contains the file "Issue.java" as given below
      * run: javac test\Issue.java
      * create a file "argfile" with the following content: -cp "C:\Users\XX\Desktop"
      * run: java @argfile test.Issue
      * notice the actual vs expected result. Now if you remove the quotes in "argfile" & run java command again, the result will be as expected

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Hello world
      ACTUAL -
      Error: Could not find or load main class test.Issue
      Caused by: java.lang.ClassNotFoundException: test.Issue

      ---------- BEGIN SOURCE ----------
      package test;

      class Issue {

          public static void main(String... args) {
              System.out.println("Hello world");
          }

      }

      ---------- END SOURCE ----------

        1. argfile
          0.0 kB
          Andrew Wang
        2. Issue.java
          0.1 kB
          Andrew Wang

            henryjen Henry Jen
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: