aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes [NX Contractor] Package and run application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "[NX Contractor] Package and run application" Watch "[NX Contractor] Package and run application" New topic
Author

[NX Contractor] Package and run application

George Fung
Ranch Hand

Joined: Jun 12, 2003
Posts: 98
This is the requiremenet:
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>]
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.

1. How to start up server and client? In non-network mode, we can start by "java -jar runme.jar alone". In network mode, we can start client by "java -jar runme.jar server". Then, how can we server?
2. It flag is left out, the network client and gui must run. I can't understand it. DOes it mean "network" mode?
Please give me some ideas about it. thanks.


SCJP, SCJD, SCWCD, SCBCD, SCEA, SCJP6
To be obtained: SCEA 5
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11509
    
  95

Hi George
If you type "java -jar runme.jar alone" then the client application will start up with no networking involved.
If you type "java -jar runme.jar" then the client application will start up and connect to the server over the network.
If you type "java -jar runme.jar server" then the server application will start up.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
George Fung
Ranch Hand

Joined: Jun 12, 2003
Posts: 98
Hi Andrew,
Thank your suggestion. how about pack the db file and suncerify.properties? If I put them into runme.jar, I dunno how to access it without decompress them into working directory.. Here's my manifest file:
Manifest-Version: 1.0
Main-Class: suncertify.gui.ApplicationRunner
Class-Path: runme.jar

Thanks........
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11509
    
  95

Hi George
I don't think you need the "Class-Path" in your Manifest. Having it there makes your classes "Extension Classes". Do you need that functionality?
Regardless, now that you have your Manifest, once you create you Jar file with that Manifest, you should be able to type "java -jar runme.jar" and the JVM will execute suncertify.gui.ApplicationRunner.
Regards, Andrew
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [NX Contractor] Package and run application