Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar vs zip in OOP1

 
Ronald Schindler
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking for some clarification. I've begun working on OOP1 and the purpose as we all know is: To learn how to use someone else's classes, how to integrate a jar file into your program.
Now the download we're asked to pick up is JavaRanchCommon.zip.
I understand that it asks me to put the zip in my classpath. (Which I am ineffectively doing). However, does this mean that this zip file is in effect considered a jar or do I have to convert it somehow.
Thanks for any assistance.
 
Rick Prevett
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no need to do anything to the .zip file. Your program will automatically access the class it wants. It doesn't matter whether the file's in a .jar or .zip file. As long as you've got the classpath part down, you're good to go.
rick
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To my knowledge a *.jar file uses the same compressing technique as a *.zip file. They are (more or less) interchangable.
The jar program includes a meta-inf directory (with...), which a 'zipper' doesn't.
Using a zipper you need to use the feature to include path information (for packages).
So for java-programs I use jar and very often make the jar file with extension *.zip to look automatically with those nice zip-programs to the content. (I love this smiley)
Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic