JDK-8015106 : Dropping backslash from the ends of command-line arguments
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 7u10
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2013-03-20
  • Updated: 2014-11-17
  • Resolved: 2013-06-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7-poolResolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
C:\Program Files\Java\jdk1.7.0_10\bin>java -version
java version  " 1.7.0_10 " 
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows Server 2003 Enterprise x64 Edition Service Pack 2

A DESCRIPTION OF THE PROBLEM :
Looks like the Java 1.7u10 started to drop the backslash from the end of command-line arguments. If you compare:

Nice comparison at http://stackoverflow.com/questions/13913196/file-separator-java-7-option-causes-exceptionininitializererror/14055630#comment19766438_14055630

public class test {
  public static void main(String[] argz) {
    for(String s : argz) {
     System.out.println( " agg= "  + s +  " | " );
    }

    System.out.println( " prop= "  +  System.getProperty( " prop " ) +  " | " );
  }
}

I start it with Java 1.7.0_07 and _10:

C:\Java\jdk1.7.0_07\bin\java.exe -cp . -Dprop=z\\ test a\\ b
agg=a\\|
agg=b|
prop=z\\|

and _10

C:\Java\jdk1.7.0_10\bin\java.exe -cp . -Dprop=z\\ test a\\ b
agg=a|
agg=b|
prop=z|



Also, this uses issues while passing file.separator=\ argument, which e.g. causes TeamCity build agent to fail: http://youtrack.jetbrains.com/issue/TW-25070

REGRESSION.  Last worked in version 7

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create the single main class from the description and run the provided commands.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
u10 should behave the same like the previous u07 or u09
ACTUAL -
Backslash dropped from the command line arguments, which should not occur.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.lang.*;

public class test {
  public static void main(String[] argz) {
    for(String s : argz) {
     System.out.println( " agg= "  + s +  " | " );
    }

    System.out.println( " prop= "  +  System.getProperty( " prop " ) +  " | " );
  }
}
---------- END SOURCE ----------
Comments
Here are my experiments: # BEFORE C:\Temp\X>j:\re\jdk\7u7\latest\binaries\windows-i586\bin\java -cp . -Dprop=z\\ t est a\\ b agg= a\\ | agg= b | prop= z\\ | # THE BUG C:\Temp\X>j:\re\jdk\7u10\latest\binaries\windows-i586\bin\java -cp . -Dprop=z\\ test a\\ b agg= a | agg= b | prop= z | # FIXED 7u15 C:\Temp\X>j:\re\jdk\7u15\latest\binaries\windows-i586\bin\java -cp . -Dprop=z\\ test a\\ b agg= a\\ | agg= b | prop= z\\ | #FIXED 7u40 C:\Temp\X>j:\re\jdk\7u40\latest\binaries\windows-i586\bin\java -cp . -Dprop=z\\ test a\\ b agg= a\\ | agg= b | prop= z\\ |
10-06-2013

What do you mean this is not ported to 7 ? Please see the followings bugs: 7u40: JDK-8006574 7u25: JDK-8010623 7u21: JDK-8009415 7u17: JDK-8009345 7u15: JDK-8007717
10-06-2013

But it did not seem like the fix was ported to 7?
10-06-2013

Duplicated by JDK-8006536, and is already fixed.
05-06-2013

Is this a dup of JDK-8006536?
22-05-2013