• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

NX:URLyBird One or two runme.jar

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my assignment , it saids "The executable JAR containing the programs.This must be called runme.jar." Whether this means only have one runme.jar , but the project contains three parts: client, server and db. How can run the server if i use runme.jar to execute client application?
And, how can i build this executable JAR file?
Help me, thanks.
 
author and jackaroo
Posts: 12200
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 Leo
All the classes you create will be in the one jar file named runme.jar. The user selects what mode to run it in by using a parameter on the command line:
  • java -jar runme.jar - the client starts up in networked mode
  • java -jar runme.jar alone - the client starts up in non networked mode
  • java -jar runme.jar server - the server starts up


  • You should look at the Sun Jar tutorial.
    On this page you will find information on how to create a jar file, and how to make an executable jar file.
    Regards, Andrew
     
    Leo Tien
    Ranch Hand
    Posts: 156
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks,Andrew. I see!
     
    Greenhorn
    Posts: 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    hy there
    how do I create a manifest file for that?
    the manifest file must it have 2 main class declartions, one for
    the server process and the other for the client process?
    if you run: java -jar runme.jar server - the server starts up
    then the server process starts and the main class is, let's say
    'Server.class'
    does the manifest file has to know the different parameters
    'alone','server', etc..
    and if yes how do you declare it then ?

    peter
     
    Bartender
    Posts: 1872
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Peter,
    Welcome to this forum.
    You need only one main class. This will receive all possible command-line arguments ("server", "alone", or none). Depending on the received command-line arg, your unique main method will instantiate a server app, a client app or a stand-alone app.
    Best,
    Phil.
     
    Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
    Gift giving made easy with the permaculture playing cards
    https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic