JToExe

Introduction

JToExe packages java applications into Windows executables. It relies on a primary class containing the function main(String args[]). This eliminates the use of a batch file and makes your Java application more professionally polished. The JToExe application consists of six tab panels which contain the options to be passed through to the jre executable. There are two possible runtime scenarios for your application.The first is bundling and shipping your application with Java Runtime Environment or JRE. The second is you know that a specific Java environment exists on the target machine so you want JToExe to co-exist with other Java applications.


In the first instance you will want to use relative paths. Your application can be move from directory to directory or even from machine to machine no matter if Java is installed on the target machine. This option is also ideal if you want to install you application on a CDRom and you are not certain what drive will be assigned to the CDRom.

In the second instance, the paths to the Java binaries is known. The paths are hard coded. The advantage to using this method is that you will save some disk space (~2,5MB/application for the JRE and additional 2MB in case you are using Swing). You won't have duplicate environments. You can still move the application around on your local machine as long as your Java environment doesn't change.

Command Tab

Path to Java binaries

Refers to the path where jre.exe is located. The path can be absolute or relative. C:\jre-1.1\bin is an example of an absolute path and .\jre-1.1\bin is an example of a relative path. In general, the relative path is most likely choice. This implies however that you are packaging the jre.exe along with you application.

ATTENTION: In case, JRE is installed on the target machine, Java always uses that version, no matter what indicate under "Path to Java binaries". That also implies that you can leave this field blank in case you can be sure, that a recent JRE or JDK version is installed on the target machine. If you want to be on the safe side, you copy the JRE in a path relative to your application and use that path for "Path to Java binaries". For more information have a look at "readme.txt" inder "Known Bugs".

Classname

This specifies the class file containing the function:
public static void main(String args[])

Optional parameters-Tab

The "String args[]" parameters of the main function.

Classpath Tab

Specifies the paths Java uses to look up classes. Java will first use the CLASSPATH environment variable and than the paths indicated here. Directories are separated by colons. The paths can be either relative or absolute. Thus the general format for path is:


.;<your_path>

For example:
C:\xyz\classes;C:\usr\local\java\classes
or
.\xyz\classes;.\usr\local\java\classes

Properties Tab

Redefines a Java property value. For example awt.button.color =green
sets the value of the property awt.button.color to "green". java accepts any number of properties. Refer to you Java documentation for details.

Environment Tab

Here you can set additional Windows environment variables. This is equivelent to using the dos set command.

Expert Tab


Show windows console

This option control whether jre.exe should display the console window. For development purpose, the console window should be left on for debugging purposes. Final applications, will more than likely want this disabled.


Use Just In Time compiler

Enabling this option means the Just In Time compiler should be used in addition to the VM. This speeds up the execution at the expense of a short delay the first time a class is called and higher memory usage.


Print a message to stdout each time a class file is loaded

This enables Java to print messages to stdout each time a class file is loaded. This is for debugging purposes.


Garbage collector should print out messages

This enables Java to print messages to stdout each time the garbage collection frees memory. This is for debugging purposes.


Turn of asynchronous garbage collection

Turns off asynchronous garbage collection. When activated no garbage collection takes place unless it is explicitly called or the program runs out of memory. Normally garbage collection runs as an asynchronous thread in parallel with other threads.


Turn off garbage collection of Java classes

Turns off garbage collection of Java classes. By default, the Java interpreter reclaims space for unused Java classes during garbage collection.


Run the verifier on all code that is loaded

Runs the verifier on all code that is loaded into the system via a classloader. That is the default for the interpreter.


Perform byte-code verification on executed classes

Performs byte-code verification on the class file. Beware, however, that java -verify does not perform a full verification in all situations. Any code path that is not actually executed by the interpreter is not verified. Therefore, java -verify cannot be relied upon to certify class files unless all code paths in the class file are actually run.


Perform no verification

Turns verification off.

Heap/Stack Tab


Minimum Heap Size

Sets the startup size of the memory allocation pool (the garbage collected heap) to x. The default is 1 megabyte of memory. The value of x must be > 1k.


Maximum Heap Size

Sets the maximum size of the memory allocation pool (the garbage collected heap) to x. The default is 16 megabytes of memory. Note, x must be greater than or equal to 1000 bytes.


Max. Stack size used by C code in a thread

Each Java thread has two stacks: one for Java code and one for C code. The option sets the maximum stack size that can be used by C code in a thread. Every thread that is spawned during the execution of the program passed to java has x as its C stack size. The value of x must be greater than or equal to 1k bytes.
The default stack size is 128 kilobytes.

Max. Stack size used by Java code in a thread

Each Java thread has two stacks: one for Java code and one for C code. The option sets the maximum stack size that can be used by Java code in a thread. Every thread that is spawned during the execution of the program passed to java has x as its Java stack size. The value of x must be greater than or equal to 1k bytes.
The default stack size is 400 kilobytes.




WindowsTM is a registered trademark of Microsoft Corporation.

JavaTM is a registered trademark of Sun Microsystems Inc.