This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Need help: new to Jcreator and Unable to pass arguments to main methold Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Need help: new to Jcreator and Unable to pass arguments to main methold" Watch "Need help: new to Jcreator and Unable to pass arguments to main methold" New topic
Author

Need help: new to Jcreator and Unable to pass arguments to main methold

bani kaali
Ranch Hand

Joined: May 05, 2002
Posts: 42
Hi,
I am new to Jcreator IDE and I am not able to set main method argumets. I know I can pass arugments to main methold by performing on the following options. I did try both options listed below,But I dont know where I am going wrong, I am still unable to pass arugment and when I print args.length it still says args =0!!
Option One
1. Choose Options from the Configure menu.
2. Select JDK Tools, select Run Application from the pull down list, Edit.
3. The Tool Configurations dialog box will be displayed.
4. Enable the checkbox ''Prompt for main method arguments"
Option Two
1. Open or Create a project.
2. Select Runtime Configurations from the build menu.
3. Select new or edit.
4. The Set RunTime Configuration dialog will popup where you can fill in the arguments.
5. Start the runtime item via the pull down menu next to the execute project-button.
I have written a simple program to check whether a data packet is valid. The program expects a (packet) argument >=2. The first entry in args[0], specifies the total length of the packet,including the first word in the count (assumption args[0]>=2).
The last word in the packet, args[args[0]-1], is a simple checksum that is computed by adding up all of the values in the previous array locations, including the length field, but not including the checksum field.
For example, here is one valid packet:
[ 10 1 2 1 2 3 4 3 4 30 ]
The smallest valid packet is:
[ 2, 2 ]
My program is compiling fine and I know it will work but I am unable to pass arguments. Can any one please take the trouble to tell me where I am going wrong??
Thanks
bani
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
I think this post should be moved to IDE forum....you probably will get a better response there.
My $0.02....


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help: new to Jcreator and Unable to pass arguments to main methold
 
Similar Threads
VM arguments, cmd line vs eclipse
Help me Pls.
Question on methods
Help! Command-line arguments
Need some help with Java program Airline.java