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

java.exe consumes argument intended for launched java class

    XMLWordPrintable

Details

    • b09
    • 7
    • b01
    • windows
    • Verified

    Backports

      Description

        FULL PRODUCT VERSION :
        C:\temp
        est>java -version
        java version "1.7.0_45"
        Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
        Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.1.7601]

        A DESCRIPTION OF THE PROBLEM :
        Take the following trivial class that prints out its arguments:

        public class A {
                public static void main(String[] args) {
                        System.err.println("args >");
                        for(int i = 0; i < args.length; i++) {
                                System.err.println(args[i]);
                        }
                        System.err.println("args <");
                }
        }

        Run the following command on Windows under 32 bit Java 6:

        C:\temp>java -version
        java version "1.6.0_45"
        Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
        Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)

        C:\temp>java A -d64
        args >
        -d64
        args <

        The -d64 parameters is passed correctly to the Java program.

        Under Java 7, 32 bit:

        C:\temp
        est>java -version
        java version "1.7.0_45"
        Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
        Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)

        C:\temp
        est>java A -d64
        Error: This Java instance does not support a 64-bit JVM.
        Please install the desired version.

        My application expects to receive the -d64 argument, but udner Java 7 it is not being delivered

        Note:

        a) It occurs with 'java -jar A.java -d64' also
        b) the java usage message is:

        C:\temp
        est>java
        Usage: java [-options] class [args...]
                   (to execute a class)
           or java [-options] -jar jarfile [args...]
                   (to execute a jar file)

        Which states that anything after the classname (or after '... -jar jarname') should be passed as an argument




        REGRESSION. Last worked in version 6u45

        ADDITIONAL REGRESSION INFORMATION:
        C:\temp>java -version
        java version "1.6.0_45"
        Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
        Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        See description

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        See description
        ACTUAL -
        See description

        REPRODUCIBILITY :
        This bug can be reproduced always.

        Attachments

          Issue Links

            Activity

              People

                ksrini Kumar Srinivasan
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: