You can add Jarx to your own Java programs and provide a better experience to the user.
You might think distributing only a JAR file to Windows users is enough. Unfortunately, a JAR file has some serious drawbacks:
Jarx overcomes all these problems.
When you distribute a Java 1.1 program, Jarx has even more advantages:
By associating the .jar file extension with the jarx program, every JAR file will become "executable". The JAR file can be double clicked, selected from the Start menu etcetera. To have a executable JAR file, it must contain a manifest file. You can find more information about the manifest file in the JAR File Specification.
A file with the .jarx file extension is a configuration file, just like the manifest file. See below for the format. In this file you can describe which JAR file to load and which class contains the main method to execute. You can start your Java software by double clicking a jarx configuration file.
If your Java program is document-oriented, you can associate your own file extension with jarx. Jarx will then execute your JAR file with the document as a parameter. A document can be anything, including, for example, an image. You can do this by making a default.jarx file in the same directory as the Jarx executable. See below for more information about the .jarx file format.
The Jarx configuration file, with the .jarx extension, gives the Jarx program information about which JAR file to load and which class to execute.
The Jarx configuration file is a text file. Every line starts with a name, followed by a colon ':', folowed by one or more spaces, followed by the value.
Name | Value | jar-file | (Relative) location of the JAR file. | Obligatory | main-class | The full class name of the class containing the static void main method, just like in a manifest.mf file | Obligatory | class-path | The classpath. When left out, the JAR file will be the only entry in the classpath. | Optional | version-min | Minimum supported Java version. When the installed version is older, the user will be asked to download the newest version. The value must have the format <number>.<number>. | Optional |
---|
An example Jarx configuration file is:
jar-file: GameOfLife.jar main-class: org.bitstorm.gameoflife.StandaloneGameOfLife version-min: 1.1
You can download the Game of Life to see how Jarx works with other software. On the Game of Life source code page, you can find an installer script for the free NSIS installer program.
You can download the plain jarx.exe or download and install the end user installer from the Jarx web page:
Jarx is Open Source and licensed under the MIT license.
You can fork the code at GitHub:
https://github.com/edwinm/Jarx
Copyright (c) 2004 Edwin Martin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For further questions, please contact Edwin Martin <edwin@bitstorm.org>.