Channels ▼

Eric Bruno

Dr. Dobb's Bloggers

Reduce Java SE's Footprint - updated

June 18, 2008

The Java SE platform has grown with each release, and update. Sun and the community have been consistently adding features and tools to the bundle, which is generally a good thing. For instance, Java SE now comes with a full-blown RDBMS, based on Apache Derby, called JavaDB. This is a great addition for those who need a mid-range database for a standalone Java application. However, for those wishing to deploy Java SE into slightly constrained environments, this can be frustrating.

Of course, there's always Java ME's CDC virtual machine, which is bytecode compatible with Java SE, for constrained devices. However, for some, there is a need or desire to stick with standard Java. One solution is to slim down the Java SE distribution, but it must be done in a way that doesn't violate Sun's license. This requirement is there for a reason; without it, the Java platform is susceptible to fragmentation, and doomed to incompatibility, and ultimately failure.

But there is a way to reduce the Java SE footprint and not violate the license. My friend, Jim Connors, has written a blog entry about it here: http://blogs.sun.com/jtc/entry/reducing_your_java_se_runtime. 

Of course, Java 6 update 10 (http://java.sun.com/javase/downloads/ea/6u10/6u10beta.jsp), with the Java kernel and modularization, goes a step further in reducing both the memory and storage footprint of Java SE. However, considering it's still in beta, and for those of you who need to stick with older versions for some time, the solution proposed by Jim Connors may be the only license-compatible choice.

Finally, there are other Sun-supported options to use Java SE on constrained devices where the distribution is reduced even further in size.  Take a look at Java SE Embedded (http://java.sun.com/javase/embedded/index.jsp) where there's support for headless environments, different CPUs (Intel, ARM, MIPS, and PowerPC), and operating systems.

Update: One reader informed me of his company's product that offers a Sun-licensed and approved method to reduce the footprint of deployed Java applications. The company is named Excelsior, and the product is called Excelsior JET. See http://www.excelsior-usa.com/java-download-size.html for more information.

Basically, it works by analyzing your Java SE application to determine its dependancies. Then it creates an executable from the bytecode that includes only the Java libraries that your application requires. It will also package the application for installation using the setup program of your choice.

With this solution, you actually don't need the JRE to be installed on the target computer. You do, however, need to follow Sun's license requirements concerning Java compilation. All of the details around this can be found on Excelsior's site. 

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 


Video