JDK-8131680 : JVM silently expands command line arguments before invoking "main()"
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 8u51
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_8
  • CPU: x86
  • Submitted: 2015-07-15
  • Updated: 2015-07-16
  • Resolved: 2015-07-16
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

FULL OS VERSION :
Windows 8.1 Professional

A DESCRIPTION OF THE PROBLEM :
IMPORTANT:
You just closed my identical bug report

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8131329

with a comment "Could not reproduce": Maybe you missed the important point that one MUST use an MS Windows JRE!?

If you still cannot reproduce the problem, please add the produced output as a comment.

THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the test program with
java.exe -cp target/classes foo.Main a "*" b

Verify that the command line arguments of the running JVM with SYSINTERNALS PROCEXP:
"C:\Program Files\Java\jdk1.8.0_05\jre\bin\java.exe" -cp target/classes foo.Main a * b

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected output:
args[0]= "a"
args[1]= "*"
args[2]= "b"
Done

Actual output:
args[0]= "a"
args[1]= ".classpath"
args[2]= ".project"
args[3]= ".settings"
args[4]= "pom.xml"
args[5]= "src"
args[6]= "target"
args[7]= "b"
Done
REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
package foo;

public class Main {

	public static void main(String[] args) throws InterruptedException {
		for (int i = 0; i < args.length; i++) {
			System.out.println("args[" + i + "]= \"" + args[i] + "\"");
		}
		Thread.sleep(5000);
		System.out.println("Done");
	}
}
---------- END SOURCE ----------