I hadn't done this in a while, and I always forget about the option to include a manifest file in the jar file. If you're good and remember to include a manifest file, like this:. But, if you don't include a manifest file and users try to run your application like that they will instead get a nice error message, like this:. FWIW, my manifest file, Manifest. Actually, this file has two lines in it. The later sections demonstrate specific modifications you may want to make. This section describes how to use the Main-Class header in the manifest file to set an application's entry point.
This section describes how to use the Class-Path header in the manifest file to add classes in other JAR files to the classpath when running an applet or application. This section describes how to use manifest attributes to increase the security of an applet or Java Web Start application. A specification of the manifest format is part of the on-line JDK documentation. Next Jar files in Java. Recommended Articles.
Article Contributed By :. Easy Normal Medium Hard Expert. Writing code in comment? Please use ide. Load Comments. What's New. Most popular in Java. More related articles in Java. Classes and Objects in Java. We use cookies to ensure you have the best browsing experience on our website. For example:. That extracts only files in the package net. LIST file that contains information about the specified jar file, such as the dependent jar files and location of all packages. This is a useful feature that shortens and simplifies a lengthy jar command line.
Just create a text file that contains jar options and arguments separated by spaces or new lines , and then execute the jar command in the following form:. For example, create a classes.
0コメント