JavaExe can launch your Java application from an .exe, as if it is a Windows application, or a system service, or a Control Panel, or a screen saver.
It is also possible to provide your Java application with a JRE to make it self whatever the configuration of the client system.
Key Features of JavaExe :
- Support for 64-bit JRE.
- Launch as a Windows Application.
- Launch as Windows Service (with opportunity to interact with Desktop).
- Launch as Control Panel of Windows.
- Launch as Screen Saver.
- Automatic detection of the type of launch according to the features used.
- Launch only one instance of the application at the same time.
- Ability to start (or restart) the Java application in Admin mode.
- Ability to run only a part of the Java application in Admin mode.
- Restoration of the Java application automatically after a system reboot.
- Service : Automatic detection of configuration changes since the creation of the service.
- Management of Services Control.
- Managing of the Taskbar.
- Shutdown Management of the PC, or the standby, locking the session, ...
- Possibility to prevent running of the screensaver, turns off the monitor, and the automatic standby of the PC.
- Managing of the Windows Registry.
- Interception of Windows systems events (such as inserting or ejecting a device, a reboot request of system, state of the battery, ...).
- Dynamic splash screen.
- Have a static splash screen (in format BMP, GIF, JPG or PNG).
- Change the icon of .EXE
- Full management of Unicode.
It is quite simply enough to copy JavaExe.exe (and JavaExe.cpl for a Control Panel, or JavaExe.scr for a Screen Saver) in your directory containing the Java application, then to give him the same name as your main .class or .jar.
JavaExe.exe is provided with a console version, JavaExe_console.exe, to allow have a console DOS to print on standard output. All that will be said on JavaExe.exe apply to JavaExe_console.exe.
If my main class names MyApp.class, I copy and rename JavaExe.exe to MyApp.exe
In the same way for a .jar, if my main class is contained in MyApp.jar, then I rename JavaExe.exe to MyApp.exe.
The .class or .jar must be in the same directory as the .EXE or in a directory named by default "resource" has to create on the same level as the .EXE
|| If MyApp.exe is in the folder "D:\Dev\", then MyApp.class or MyApp.jar is :
- either in "D:\Dev\"
- or in the directory "D:\Dev\resource\"
JavaExe isn't an independent executable of a JDK or of a JRE, it is necessary to have installed at least a Java Runtime Environment (JRE). If JavaExe doesn't detect a JDK or JRE, it will open an Internet browser to the Sun's website to download the current JRE.
You can provide a JRE with your application. In this case, you must put it in a directory named "jre", itself in the directory of the EXE or the directory "resource".
If MyApp.exe is in the folder "D:\Dev\", with a local JRE for this application, then this JRE is :
- either in"D:\Dev\jre\"
- or in the directory "D:\Dev\resource\jre\"
It's possible to specify which minimum version of Java you wish to use to launch your application. For that you must create a file, JavaExe.properties, bearing the same name as the main .class or .jar (as for the renaming of JavaExe.exe).
This file contains 12 properties used by JavaExe :
There can be other properties if your application uses this same file for its own needs.
- JRE version (or JREversion) = to specify the minimum version of java: 1.4 ; 1.3 ; ...
- Run Type (or RunType) = to specify how the application must be launched : '3' for a ScreenSaver, '2' for a ControlPanel, '1' for a service-application, or ' 0' (or nothing) for a normal application.
- Main Class (or MainClass) = to indicate the complete name of your main .class if it's in a package : myPackage.MyClass (only if there is no Manifest file in the .jar).
- Main Args (or MainArgs) = these values will have passed in arguments to the main method of your main class, in the variable (String args).
- Resource Directory (or ResourceDirectory) = to specify the resource directory containing the DLL, the image, the properties files,…. If this parameter isn't specify, the directory named « resource » will be use by default.
- Class Directory (or ClassDirectory) = to specify the directories (separated by ‘;') to recursively scan to find all .jar or .zip files to add in the ClassPath.
- Personal Classpath (or PersonalClasspath) = if your application needs additional .jar or .class files or being in other directories.
- Personal Options (or PersonalOptions) = to specify the JVM parameters.
- Path JRE (or PathJRE) = pathname of the JRE if it is provided with the application. By default it will be required in the directory “jre” on the same level as the .exe or in the directory “resource”.
- Path Browser (or PathBrowser) = pathname of the browser to be used for the installation possible of a JRE (by default it is the pathname of InternetExplorer).
- Display BoxInstall (or Display_BoxInstall) = to indicate if a message must be displayed when JavaExe does not find a JRE or JDK, and asking whether one wishes to install a JRE or to leave the application. Only two values are accepted : '0' or '1'.
- URL InstallJRE (or URL_InstallJRE) = allows to indicate a URL on which JavaExe will open a browser if no JRE or JDK is found with the launching of the application. If this property is not indicated, it is the URL on java.sun.com which will be taken.
If MyApp.exe is in the directory "D:\Dev\", then MyApp.properties can be in this same directory or "D:\Dev\resource\".
In this example, MyApp.properties contains :
- JRE version = 1.2
- Personal Classpath = .\resource\classes12.zip
- MainArgs = "test" 123
MyApp will then be launched with Java 1.2 (or higher), and the corresponding command-line is :
java -classpath .;.\resource\MyApp.jar;.\resource\classes12.zip MyApp "test" 123
to see the complet doc :
|| JavaExe is provided with another program, UpdateRsrcJavaExe, making it possible to change the icon of your MyApp.exe. To change the icon, you must drag your MyApp.exe and your icon file (in .ICO format) to UpdateRsrcJavaExe.exe.
JavaExe and UpdateRsrcJavaExe are creations and copyrighted of DevWizard (DevWizard@free.fr).
You are free to use them and provide them with your applications you want to distribute, that they are freeware, shareware or commercial. Only DevWizard is authorized to make an unspecified modification to JavaExe and UpdateRsrcJavaExe.
Any request for modification can be made by mail to DevWizard@free.fr