Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

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

 
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
 
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....
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic