• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

NX: Mode Flag When Running Program

Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When running the executable jar and specifying the mode flag of "server" or "alone", are the quotes included as one of the "musts"?
For example, which is the acceptable version:
java -jar c:\runme.jar "alone"
java -jar c:\runme.jar alone
My assumption is the latter (without quotes), but I want to be 100% sure. The specification illustrates the mode flag with quotes.
The program will run either way (i.e. with our without the quotes), but I'm wondering if I need to be paranoid enough so that it rejects alone if it was expecting "alone". I'm shaking my head at this possibility, but now I'm a little gun-shy of my submission and want everything spelled out, just to be sure.
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jason,

Originally posted by Jason Mowat:
java -jar c:\runme.jar alone

This is the correct one (without quotes). I think you can safely reject any command-line arguments other than the following: alone, server. If you detect some other command-line argument, I would suggest you respond with something like the following before terminating the program:

Hope this helps,
    Bookmark Topic Watch Topic
  • New Topic