Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

nx:All of URly Bird 1.1.3 applications package and using jar

 
liqun chang
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi George and Andrew and other experts:


When you submit your assignment, each part (client and server) must be executable using a command of this exact form:

java -jar <path_and_filename> [<mode>]
Your programs must not require use of command line arguments other than the single mode flag, which must be supported. Your programs must not require use of command line property specifications. All configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory.
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.



My question is:In my design,i have two applications Client(contains main method) Server(contains main method).Wether i must package these two applications into one jar file(runme.jar)and how could i do?

If i package Client in a jar file,i can do it(in manifest i specify Main-Class) and run well, then i package Server in anoter jar file(in manifest i specify Main-Class) an run well.But how can i package two applications in
only one jar file?

please you help me?
[ June 06, 2004: Message edited by: liqun chang ]
 
Javini Javono
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You'll need one application called, say, TheApp.java,
which is executed when this command is given:
java -jar runme.jar

TheApp then tests its args and then starts up the
appropriate app like this:

if (...) {
AppropriateApp.main(...);
} else {...


Thanks,
Javini Javono
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi liqun
I am doing Bodgitt and Scraper, but the requerments are alomst the same.
You can just make one class with main method, which checks for the command line argument, then launch the appropriate application. typicaly it is done in if else statement.
 
liqun chang
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:Hanna and Javini thanks for helping me.

Whether you tell me.I have Client(has main method) and Server(has main method )applications.I must create a App that has main method.In this method
i can do so:if(...){Client.main();} and else{Server.main();}.Am i right?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Liqun,

Yes, that will be a good solution for you.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic