2.3.1.Java/Swing™ Test Project
A typical Java/Swing™ application is a set of class files bundled together in one or more Java Archives (jar) files. In all these classes, there is a special class that has a
main method that is the entry point into the application. Once you know the main class and have the list of JAR files, the application is launched as follows:
java -cp <list-of-jar-files> <main-class-name> <application-arguments>
As this is a cumbersome way of launching an application, Java provides a set of tools to ease the deployment of the applications.
- Java Webstart™
Java Web Start is a framework developed by Sun Microsystems (now Oracle) that allows users to start application software for the Java Platform directly from the Internet using a web browser. The launch information of the application is provided in a JNLP file. The file along with the application JAR files are stored in an accessible location for the user. The user needs to download the JNLP file and use
javawstool to launch the application. Java web start is also integrated into most desktop operating systems. So opening a JNLP file automatically launches the application.
- Executables and Batch files
Java applications are also typically wrapped as exeutable files or batch files. When the user runs this file, the arguments and the environment is processed and a properly constructed java command line is executed.
Some java applications are deployed as applets. The applets are executed within a browser environment.
- Executable JAR
Java applications are also distributed as JAR file that can be launched with
java -jar <jar-file>command.
When you create a project (or a fixture – more about it later) – you need to select an appropriate launcher that correspond to the way your application is launched. MarathonITE provides launchers for Java command line, web start, applet, executable jar and command line.
In this tutorial, we shall use java command line launcher to start the application. The User Guide explains all other types of launchers in detail.