This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 23202

Summary: Command line parameters do not behave when run from netbeans
Product: platform Reporter: navneet <navneet>
Component: ExecutionAssignee: David Strupl <dstrupl>
Status: CLOSED INVALID    
Severity: blocker    
Priority: P1    
Version: 3.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:

Description navneet 2002-05-07 12:20:42 UTC
Build: 200205070100
OS: Windows 2000
JDK: 1.4.0

When running any java program from the commandline, args
[0] points to the first parameter, but when invoked from 
netbeans, args[0] points to the name of the class.
Comment 1 David Strupl 2002-05-07 13:13:36 UTC
I am very sorry but I have to close this report as invalid.
I have tried this program

    public static void main(String[] args) {
        for (int i = 0; i < args.length; i++) {
            System.out.println("args[" + i + "] == " + args[i]);
        }
        System.out.println("DONE!");
    }    

And both from IDE and running standalone always have seen the params
as they should (I have tried today's build on Linux and W2000).

So could you please send a step by step what have you done in the IDE
so that I can reproduce the problem? After you supply this information
please reopen the issue. Thanks.
Comment 2 navneet 2002-05-07 14:11:04 UTC
I'm really sorry. Don't know how i could do this. But the 
parameters in the IDE were more than the ones on the 
commandline.
Comment 3 David Strupl 2002-05-09 08:23:11 UTC
No need to apologize - but how did you find out that something is
wrong? Were your program similar to my program? What have you done in
the IDE? Please check what do you have in the Execution tab in the
Executor property (while having the node you are trying to run
selected in the explorer).
Comment 4 navneet 2002-05-10 09:20:21 UTC
I was using a similar program. I set the parameters using 
the build/set arguments method. And then the program was 
not getting the parameters as expected, so i tried to 
trace. And found the additional parameter.

I tried attaching to a jvm running from the command line 
and saw the right behaviour. So mistakenly conclude the 
above.
Comment 5 David Strupl 2002-05-10 10:44:05 UTC
Ok. So leaving this issue as closed.