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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Packaging assignment jar..." Watch "Packaging assignment jar..." New topic
Author

Packaging assignment jar...

Roman Yankin
Ranch Hand

Joined: Aug 27, 2008
Posts: 47
I have a set of rules concerning the structure of files in my jar file, the only thing i'm not certain about is the root class folder containing my compiled classes. In my case it is called suncertify (again per given instructions) but my packaging instructions do not say that suncertify must be one of the root folders in runme.jar. The only phrase that gives indirect hint is "The JAR file must have the following layout and contents in its root: The executable JAR containing the programs..."

Could someone clarify on that, I just want to make sure I'm doing everything correctly,

Thanks,

BTW Here is the contents of my JAR, does it look fine?

META-INF/
META-INF/MANIFEST.MF
code/
code/Application.java
code/db/DB.java
code/db/Data.java
docs/
docs/javadoc/
docs/choices.txt
docs/instructions.html
docs/userguide.txt
suncertify/
suncertify/Application.class
db-2x3.db
version.txt


I'm not sure if META-INF/ folder is fine and would not result if automatic failure, but as far as I understand there is no other way to define main class other then specify it in manifest.mf file which automatically moved to META-INF/ folder
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Hi Roman!

Originally posted by Roman Yankin:
In my case it is called suncertify (again per given instructions) but my packaging instructions do not say that suncertify must be one of the root folders in runme.jar. The only phrase that gives indirect hint is "The JAR file must have the following layout and contents in its root: The executable JAR containing the programs..."


Your compiled classes should be packaged in a jar called "runme.jar". Then, runme.jar along with all the files you listed (except the classes) must be packaged in another jar called something like "YourPrometricID.jar". This second jar is the file you'll be submitting.


I'm not sure if META-INF/ folder is fine and would not result if automatic failure, but as far as I understand there is no other way to define main class other then specify it in manifest.mf file which automatically moved to META-INF/ folder


The manifest file is always in the META-INF folder at the root of the jar. You don't have to have this folder&file, but (if I recall correctly) it is part of SUN's standards/recommandations. Definitly, both your jar should have this folder&file.

- Your runme.jar's manifest could provide the main class + version number, author...
- Your "outer" jar's manifest could provide other info such as description, version, author...

About the main class, you are right. If you don't have a manifest, then you would have to specify the main class in the launch command (which would go against one of your requirement).

With all I've just said, try to read again the packaging section!

good luck,
Alex
[ September 16, 2008: Message edited by: Alex Belisle Turcot ]
Roman Yankin
Ranch Hand

Joined: Aug 27, 2008
Posts: 47
Thanks a lot Alex! I bet you've saved me from automatic failure, no kidding! I have not realized that "runme.jar" has to be packaged into another jar. BTW, my assignment instructions does not even mention the way I should name global jar file that contains everything they simply say
All elements of your submission must be packaged in a single JAR file.
Wow, I'm really happy to find this out now and not after the submission!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Packaging assignment jar...