GlassFish on Ubuntu with JDK 6

Couple of folks have asked us the reason GlassFish requires JDK 5 on Ubuntu - inspite of the fact that we bundle JDK 6 in Ubuntu. In this short blog, I will answer this question and list the steps to run GlassFish with JDK 6.

GlassFish is used to build the Java EE Reference Implementation. Java EE moves lockstep with JDK versions, for e.g: Java EE 5 with JDK 5, J2EE 1.4 with JDK 1.4 and so on. This was one of the biggest reason for us to require JDK 5. Having said that, the GlassFish works with JDK 6 as well.

Another reason, was that JDK 6 and GlassFish integrations were happening in parallel. Leaving us little time to effectively test with JDK 6. GlassFish with JDK 5 has gone through the entire SQE tests (about 15000 tests) and the Java EE Compatibility tests (some 17000 of those) - we just did not have the cycles to do that level of testing for JDK 6 before the release on Ubuntu.

Steps to run GlassFish on  JDK 6

The easiest way to change from JDK 5 to JDK 6 is to go to /usr/share/sunappserver/config/asenv.conf and change the AS_JAVA variable to point to JDK 6. This will change the JDK for all domains installed - which is the right way to do it IMO.

Another way to do this, is to run the following command:

sudo /usr/share/sunappserver/bin/asadmin set "server-config.java-config.java-home=path-to-jdk-6".

This changes the JDK per domain basis.


Upgrading from JDK 5 to JDK 6 should work seamlessly. There is a caveat while moving back from JDK 6 to JDK 5. If any code is generated with JDK 6 - you may run into compilation issues with JDK 5.  

 

Comments:

In the past I have used this technique of modifying asenv.conf to change which Java SE version GlassFish would use. It has worked pretty well for me. I would add to Harpreet's warning that in some cases in which some code was generated and compiled under Java SE 6 I got runtime errors trying to run with Java SE 5 with a class version mismatch error. Redeploying the relevant app should take care of such problems.

Posted by Tim Quinn on April 24, 2007 at 07:24 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

harpreet

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today