• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Packaging jars

 
Charles Dupin
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some classes of server.jar are needed by client.jar.
Is it safer (1) to put in the MANIFEST of client.jar that server.jar must be in the path of client.jar, or is it safer (2) to duplicate the classes in client.jar.
In case 1 if client.jar is alone on a client machine client will not start and this is case of automatic failure. In case 2 there is redundancy of placing the same classes in the two jars.
Which is best?
Thank you.
 
Charles Dupin
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry this is a silly question. My assignement says:
Execution of Submissions
Your submission must run under a production (not development) version of Sun's Java 2 Platform. You may develop using an IDE (Integrated Development Environment) but your final product may not have any residual dependency upon that.
When you submit your assignment, you must ensure that it is packaged in such a way that it is completely clear how the examiner should run it using a java command line. Specifically, you should document clear, simple command lines that allow your programs to be run on any Java 2 platform, regardless of the underlying hardware and operating system. These command lines may only take configuration parameters selected from this list:
DNS name of the server
Port number used by the server
Data file name(s)
java.rmi.server.codebase
security manager policy file.
Thanks
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the best option is (3) to put shared classes in a third common.jar, and use the Class-Path manifest attribute to glue that common.jar to both client and server jars.
- Peter
 
Charles Dupin
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is about what I did, but what if the assessor tries to run the client on a machine where he does not install the glue jar. He is not going to read the MANIFEST file in the client.jar anyway. He will get a ClassNotFoundException. (I am may be a little bit paranoid) I should stay .
[ February 16, 2003: Message edited by: Charles Dupin ]
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, your README could outline which files are needed where.
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic