• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX:How to jar my assignment?

 
Nick Lee
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11914
209
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nick Lee
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 11914
209
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 11914
209
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Damu,
Are you asking about what package to put it in: if so, that could be a logical place for it.
Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic