Jump to content
Excelsior Forums
pdot

Jet 5, integrity of rt.jar in xjre

Recommended Posts

Hi

I'm in the process of evaluating jet 5 (we currently use Jet 3.7 to compile our application into a Windows native executable).  I'm trying out the high disk footprint reduction where the components not used by the application are stripped out and downloaded as required.  The question I have is related to the contents of the rt directory which gets distributed with the product during an installation of a packaged product.  Is there anything which ensures the integrity of libraries like the rt.jar in libs ?  How are the contents of the rt used at runtime ?  What's to stop someone altering, say the ClassLoader class from rt.jar and storing the bytes from the loaded classes to disk at runtime ?

Any information would be greatly appreciated.

Share this post


Link to post
Share on other sites

After deployment, rt.jar in xjre (rt) folder contains only those classes  not proved by the Global Optimizer to be used by your application.

Since ClassLoader.class is always used by your Java application implicitly, it will never be in rt.jar and will not be dynamically compiled at run-time. As a result, it cannot be altered.

As to other classes from rt.jar that remain after deployment, theoretically they can be altered by a malefactor. If the Test Run was not performed thoroughly and your application loads some classes from the rest of rt.jar at some execution path, then the malefactor can feed furtively altered classes to the JET runtime.

However I cannot imagine what he/she can steal/get with it.

Share this post


Link to post
Share on other sites

thanks for the reply, that's what I thought .. I just wasn't 100% certain exactly what was in the libs left in the xjre (I should have had a closer look at what was in the jar) ... so the global optimizer essentially does the same job that jet perfect used to do in 3.6 and 3.7 versions of jet ... then packaging includes the remainder of the jre that wasn't detected during runtime profiling and compiled into the native binary ?

Share this post


Link to post
Share on other sites
that jet perfect used to do in 3.6 and 3.7 versions of jet ... then packaging includes the remainder of the jre that wasn't detected during runtime profiling and compiled into the native binary ?

Yes, though not only run-time profiling but also a static analysis on global call graph is employed to detect the used and unused parts.

---------------

In addition, you may remove (a part of) the remainder from the application installation. For details and examples, check this out

    http://www.excelsior-usa.com/java-download-size.html

Share this post


Link to post
Share on other sites

If we're talking about Global Optimizer vs. JetPerfect, I must say that JetPerfect is suitable only for close world applications, while Global Optimzer can optimize any application. For instance, we have IntelliJ IDEA compiled with Global Optimizer in our testsuite and it wasimpossible to compile IDEA with JetPerfect.

Often, JetPerfect'ed applications crashed on an attempt to load undetected class with "incomplete usg" message that you might be familiar with. A globaly optimized application just loads non-compiled classes dynamically and you may even miss this fact. That's why xjre folder is not just "stuff for Java Compatibility".

P.S. We even thought to name Global Optimizer as JetPerfectII, however the negative experience with the "incomplete usg" message that many JetPerfect users had been complaining for years convinced us to throw the thought away.

Share this post


Link to post
Share on other sites

Not to mention that the Global Optimizer is supported in the JET GUI tools whereas JetPerfect had only command line interface.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×