• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hopefully the last doubt..on Mode

 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My assignment says:
The mode flag must be either "server", indicating the server program must run, "alone", indicating standalone mode, or left out entirely, in which case the network client and gui must run.

I have read this so many times so far. But still I have doubts and want to clarify them.
Parameter Client Server
server Will not start Will start
alone Will start in standalone mode.
(server is not required to run in this case)

spaces will start in standalone mode.

Please correct me if I am wrong, or confirm this if I am correct.
Thanks for your help.
Manoj
 
Ken Krebs
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jmannu,
Assuming your program is in runme.jar, if you invoke your program as follows:
java -jar runme.jar
This will run the client.
java -jar runme.jar server
This will run the server.
java -jar runme.jar alone
This will run in standalone mode.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ken,
If so, I have some more problems.
My application has 2 entry points.
Client.java starts the client GUI application, and Server.java starts the server RMI application.
If I can only use 1 jar (as stated in the instruction.html that the executable JAR containing the programs must be packaged into a single JAR file, called runme.jar), is that I need an EXTRA class, say Starter.java to determine which application should I called?

Is that I need to do this?
Otherwise, how can i allow the single jar file being executed for 2 types of applications?
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ken,
I got it.
I assume :
java -jar runme.jar
This will run the client.

Means that the client will start in the NETWORK mode.

And Nicholas, you need a starter class as you call it, and it has to be added to the manifest of the jar as the main class.
Thanks,
Manoj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic