Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
bani kaali
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this post should be moved to IDE forum....you probably will get a better response there.
My $0.02....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic