dev@glassfish.java.net

decision w.r.t. Java class version for GFv3-trunk sources ...

From: Kedar Mhaswade <Kedar.Mhaswade_at_Sun.COM>
Date: Tue, 17 Feb 2009 15:41:18 -0800

This is what we decided in the morning meeting.

http://is.gd/jTnz

Let me know if we are on the same page.

Giving you a summary for convenience:

Since by definition, Java EE 6 requires Java SE 6 runtime, it is obvious that we
use Java 6 for compilation. Thus, the javac used for compilation of Java sources
in GlassFish v3 trunk is /bin/javac (or its equivalent). Now, the target for
such a build is Java 6 runtime. Thus, by default, i.e. if we don't specify the
-target option on javac, the generated classes would have a Major Version of
50.0 (which corresponds to Java 6). Thus, if we did that, all the modules will
only create classes that can be loaded by Java 6 runtime. In order to support
Java 5 runtime which might be required by some of the components (although their
source are checked in to v3 trunk), here is the decision taken:

    1. GlassFish v3 must be run with Java 6+ runtime only. (Can someone clarify
if it applies to all the distro's?)
    2. We use javac from Java 6 for compilation. Because of that, any module can
declare compile-time dependencies on Java 6 classes, e.g. java.io.Console.
    3. We use -target as 1.5 which means, by default, the major version of
classes generated by build would be 49. This is to take care of running certain
modules with Java 5 runtime.
    4. asadmin will detect an attempt to run GlassFish with Java 5 Runtime See:
7038 and will flag it as an error.


Regards,
Kedar