• 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author and jackaroo
Posts: 12199
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Liqun,

Yes, that will be a good solution for you.

Regards, Andrew
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic