Excelsior JET Made Easy
Excelsior JET includes
xjava -- a command-line tool similar
javaw launchers that come with
the Sun JRE. In addition to launching Java applications, it can perform
partitioning optimizing compilation, which is a unique feature
of Excelsior JET JVM. In this way, the major part of your application
can be optimized using JET's static compiler prior to deployment.
The Java components that were not optimized are handled by the JET's
dynamic compiler on the production system. This approach provides high
flexibility for the deployment of your applications. The core components
can be deployed as high performance native executables. At the same time,
dynamic deployment of the Java bytecode is supported effectively.
Partitioning optimization consists of the following steps:
- Running the application on the developer system using the
- Stress testing the critical components that you want to be optimized for maximum performance.
- Optimizing the components by the JET's static compiler.
Then, you can deploy the pre-optimized application to production systems.
Optimizing your application
To run your application under Excelsior JET JVM using the
launcher, you normally just need to replace the
javaw command with
xjava. For instance, the following
xjava -Xmx128m -cp MyLib.jar foo.bar.MainClass
runs your application. In this mode, the JET VM uses its dynamic compiler to transform the Java bytecode into the native code that runs on the hardware. In addition, JET caches the Java classes loaded into the JVM to optimize them later using the more powerful static compiler.
As the application starts, stress test it using any automatic testing system. For example, if you develop a Web application, you may use Apache JMeter. The more functionality of the application is tested, the more components will be later optimized with the JET's static compiler. You may re-run your application as many times as you wish, supplying, for instance, different input data. The components not tested will be handled by the dynamic compiler on the target system, so do not worry about incomplete testing.
After that, you optimize your application by simply adding the
-Xcompile option to the
xjava command line that
you previously used:
xjava -Xcompile -Xmx128m -cp MyLib.jar foo.bar.MainClass
-Xcompile option changes the behavior of
completely. Instead of running your application, it re-compiles the
classes cached on the previous steps into a single dynamic library.
In addition, it creates a custom launcher
a small executable that loads the library and starts your application.
Now you may run the optimized application by simply typing:
As custom launcher is created, you can deploy the optimized
application. In a general case, you will have to deploy all the
original .jar (.war, .ear) files together with the produced dynamic
linked library and the JET runtime libraries. This limits the usage
xjava to situations when the distribution size is not an
issue, which is typical for server-side applications.
The Excelsior JET toolkit includes JetPackII, a GUI tool that eases deployment of the compiled Java applications. To prepare the installation package, start JetPackII, create a new project and add the launcher executable to it. For the next steps, consult the JET User's Guide, Chapter "Deployment automation."
Please refer to Excelsior JET User's Guide for technical details:
To read more about
xjava, see Chapter "Mixed compilation model," Section "xjava launcher."
- For more information about deployment, see Chapter "Deployment automation."