Jump to content
Excelsior Forums
Sign in to follow this  
Daniel

Compiling Java Application, that uses IBM JRE/JDK

Recommended Posts

Hello,

I have an application that makes use of the IBM JRE and was developed with the IBM JDK. Is it possible to compile this application and let it use the IBM JRE installed on the client, so it behaves in the same way, like it was distributed as an JAR file running under the IBM JRE?

Share this post


Link to post
Share on other sites

Excelsior JET is a complete JVM implementation itself. It does not need and can not  use any other JVM such as IBM JVM or Sun JVM.  On the other hand, Excelsior JET can compile and run any J2SE compatible application.  So the answer to you question is:

1. You can compile your application with Excelsior JET.

2. It will behave in the same way, like it was distributed as an JAR file running under the IBM JVM, if it does not use any specific IBM JRE features, i.e. it does not strongly depend on IBM JRE (is it your case? if not, what specific feature do you use from IBM JRE?), f.i. it can run on Sun JRE.

3. It will NOT use the IBM JRE installed on the client. You will need to distribute Excelsior JET Runtime components with your application (using JetPackII tool for it, included to JET).

Share this post


Link to post
Share on other sites

Thank you, for your detailed answer. I thought there is an option named -Djet.usejre which tolds the Compiler, that the specific code uses the JRE found under JAVAHOME installed on the client. So, what is this option good for?

Share this post


Link to post
Share on other sites

The option -Djet.usejre is obsolete since Excelsior JET 4.0.  Before JET 4.0, the option was used for debuging purposes only: it disabled JET native methods implementation and enabled Sun JRE native methods implementation instead. So our support engineer could ask you to enable this option, to see if the particular problem is in natve methods implementation.

And before JET 4.0, JET really used Sun JRE in some cases, for instance for AWT native methods. Moreover it required Sun JRE to be installed on.

If you use Excelsior JET 3.7 or a prior version, than the answer to your question is bit different:

JET can not be installed on top of IBM JRE (to use IBM awt native methods, for instance) and particularly it can not use IBM JRE installed on the client.

Share this post


Link to post
Share on other sites

Thank you for your explanation. Finally I have one more question about the implementation.

What about the JET Runtime <-> Sun JRE relationship? Do you took the Sun JRE and compiled it with your Compiler to a native version for the specific platform or do you as a draft for writing your own runtime environment?

I ask that, because I want to know, if I should expect errors or misimplementation in your JET Runtime which does not occur in Sun JRE or vice versa...

Share this post


Link to post
Share on other sites

Let us split the term "Runtime"? in two parts:

1. Java SE Platform: Java API classes and native methods libraries.

2. JVM itself: namely Memory Manager, GC, JIT, JNI support, Reflection support, etc.

As for 1.)

Do you took the Sun JRE and compiled it with your Compiler to a native version for the specific platform or do you as a draft for writing your own runtime environment?

Basically, it looks as follows.

a/ Excelsior LLC licensed the Java technology from Sun Microsystems

(see http://java.sun.com/j2se/licensees/index.html)

and now operates according to Sun Community Source License, Commercial Use

b/ After that, we took the Java API sources and introduced only a few optimizations into some core Java SE classes (leaving external interface intact as required by our license agreement with Sun.)

We reimplemented only the core native methods strongly related to JVM (for instance ClassLoader.defineClass0)

c/ We passed the huge Java Compatibility Kit test suite (JCK) for Java SE 5.0 and 1.4.2 received from Sun as a part of our agreement.

d/ Finally, we published our compatible implementation of the Java SE platform

As you see, the path is a bit longer than "take Sun JRE and compile it" ;)

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

As for 2.) Excelsior has created a clean room JVM implementation. It means that Excelsior JET does NOT use any piece of code from Sun JVM (only the Java API code.)

What does it mean for?Sun JRE -> Excelsior JET migration? Both JVM implementations have passed JCK.? That is, any application written according to the Java language and virtual machine specifications MUST run identically on these JVMs. However it does not protect you from bugs specific for particular implementation, of course (the compatibility kit is not claimed to be a complete robustness kit.)

In our Technical Support, we faced one major problem concerning different behavior of the JVMs. The Sun JNI implementation has weaker checks for JNI misuses than Excelsior JET. It means that native methods that are written INCORRECTLY w.r.t. the? JNI specification, may occasionally work with Sun JVM, but it might happen that they will not work with Excelsior JET. It is the root cause of the most popular problem "Runtime error: trap #3 in JET."

In most cases, such problems appear when the app uses some low-quality free libraries that were not tested well enough.

Share this post


Link to post
Share on other sites

I really thank you for your valuable time. Now I understand, how it works. I had success compiling my java application with JET Excelsior at the first try! I wish you much success with Excelsior JET!

Greetings from Germany

PS: Sorry for bad english, if it is... ;)

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
Sign in to follow this  

×