aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX:How to jar my assignment? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX:How to jar my assignment?" Watch "NX:How to jar my assignment?" New topic
Author

NX:How to jar my assignment?

Nick Lee
Ranch Hand

Joined: Dec 17, 2002
Posts: 45
In my instruction,it said:
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.

Can anybody tell me how to jar it,and how to run it with java -jar command?


Nick Lee
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11278
    
  59

Hi Nick
You should look at the Sun Jar tutorial.
(Note to Jim: That tutorial should probably be on the SCJD FAQ and links page)
On this page you will find information on how to create a jar file, and how to make an executable jar file.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Note to Jim: That tutorial should probably be on the SCJD FAQ and links page
<cough> Ahem. Yes, right. Along with a few other changes which I seem to have forgetten about, eh? Sorry, I must've been at the wheel. Will update shortly.


"I'm not back." - Bill Harding, Twister
Nick Lee
Ranch Hand

Joined: Dec 17, 2002
Posts: 45
Hi Andrew,
I know sth about JAR file,but I still confused about what the instructions said.My program now,can be run by command line(both server and client),after jar my classes,I should run both of them with java -jar jarname [mode],am I right about it?
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11278
    
  59

Hi Jim and Nick
Jim:: Along with a few other changes which I seem to have forgetten about, eh? Sorry, I must've been at the wheel.

I wasn't suggesting that - I try not to give volunteers a hard time ... whenever you have time is fine.
Nick: after jar my classes,I should run both of them with java -jar jarname [mode],am I right about it?

Yes, that is how you should run them.
Regards, Andrew
Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
Hey,
I put my ServerGUI.class into my suncertify.dbserver package, and ClientGUI.class into suncertify.dbclient package, then my question is : if I should create a main class and put it into suncertify package and run it according to its command line?
Damu
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11278
    
  59

Hi Damu,
Are you asking about what package to put it in: if so, that could be a logical place for it.
Regards, Andrew
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NX:How to jar my assignment?
 
Similar Threads
Conexion of server
standalone v server mode
B&S: Command Line
NX:RMI-How to keep the RMI factory service running always?
NX: how can I use my policy file