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.
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
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 ?
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