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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 14, 15
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      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 ----------

        Attachments

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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: