[5] A JAR file allows Java runtimes to efficiently deploy an entire application, including its classes and their associated resources, in a single request.
This prevents malicious code from being inserted into an existing package, and so gaining access to package-scoped classes and data.
The content of JAR files may be obfuscated to make reverse engineering more difficult.
Executable JAR files have the manifest specifying the entry point class with Main-Class: myPrograms.MyClass and an explicit Class-Path (and the -cp argument is ignored).
For instance, Microsoft Windows users who prefer having Windows EXE files can use tools such as JSmooth, Launch4J, WinRun4J or Nullsoft Scriptable Install System to wrap single JAR files into executables.
An entry point is any class with a public static void main(String[] args) method.
This information is provided in the manifest Main-Class header, which has the general form: In this example com.example.MyClassName.main() executes at application launch.
A package might be sealed to ensure version consistency among the classes in the software or as a security measure.
Using the multi-release feature allows library developers to load different code depending on the version of the Java runtime.
A multi-release jar is enabled using the following declaration in the manifest: The MANIFEST.MF file can be used to specify all the classes that must be loaded for an application to be able to run.
[11] Note that Class-Path entries are delimited with spaces, not with the system path delimiter: The Apache Ant build tool has its own package to read and write Zip and JAR archives, including support for Unix filesystem extensions.
The org.apache.tools.zip package is released under the Apache Software Foundation license and is designed to be usable outside Ant.