When to Use JARs

As you have seen, using JAR files in an application or applet have many advantages over multiple class files or the standard ZIP file format. When deciding whether to package or bundle a set of class files or resources as a JAR, here are some questions to ask:

  • Is the user of the JAR file concerned about security on his system?

  • Can the application or applet be bundled?

  • Does the application need to take advantage of compression?

  • Does the application or applet need to be versioned?

  • Is download time an issue?

Obviously, there are probably other criteria to use when trying to decide on creating a JAR file out of an application or applet. Each system is different and has different requirements and constraints. However, by using JAR files ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.