• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting the hostname from command line - Is it a violation from Instructions.

 
Jayakumar Duraisamy
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have written my README file and still in the 90% Syndrome. A sudden question popped out in my mind. Right now i am passing the hostname, port no, to the CLIENT through java command line by using -D flag. Something like as follows.
java -Drmi.server.hostname=localhost -Dportno=1099 -Ddatafile=db.db MyClient.
I am sure about all except the hostname. This doubt has rose after reading a recent postings by Tina et all.
Any help is highly appreciated.
Thanks
Jay
 
Akanimo Udoh
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay,
I think you may be misusing the command line in the example you gave:
"java -Drmi.server.hostname=localhost -Dportno=1099 -Ddatafile=db.db MyClient"
If you see the help for the java command line options it describes the '-D' option as
-D<name>=<value> set a system property
and you can get a list of these 'system' properties if you look at System.getProperties() in the online help.
Its not really the proper way to pass 'application' parameters like the RMI server address, port, filename etc. These type of parameters should really go to the application's main function for handling.
See Tina's thread for some more comments on the rmi.server.hostname system parameter.
Akanimo.
 
Jayakumar Duraisamy
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I appreciate your reply.
As far as i understand, it is nothing wrong to use -D to set port. Because as far as our application is considered it is a system property.
I also understood later, that specifying the hostname via commandline is not violating the instructions.
Thanks
Jay
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic