Getting Started with Glassfish 3 on Ubuntu Server 9.10
Posted in General on January 14th, 2010 by Simon Connah – 1 CommentIn this article I hope to introduce you to Glassfish 3 on Ubuntu Server 9.10.
The first thing you need to do is make sure that you have the Java Developer Kit installed on your server. There are two options available, the Sun JDK or OpenJDK. Not knowing if there is any advantage to using OpenJDK I personally opted to use the Sun JDK. If anyone has any information about any advantages that the OpenJDK offers then leave a comment and let me know! Simply install the JDK by running the following command:
sudo apt-get sun-java6-jdk
this will install all the needed dependencies for you as well.
Next you need to download Glassfish 3. Personally I find it best to download it as part of the Java EE 6 SDK which is available here. Make sure that you select Linux in the Platform drop down menu before you download it though. I also suggest you download the larger of the two choices (70MB at the time of writing), this means that you are getting Glassfish with all features enabled where as the web profile has some of the enterprise features left out for size reasons. Obviously if your requirements are met by the web profile then by all means use that. The installation process should be the same as described here.
Once you have downloaded the Java EE 6 SDK you will need to install it using silent mode as the standard install requires X11 which is not included in the standard Ubuntu Server installation. In order for this to work you need to create an answers file (standard text document) that specifies the installation parameters that you wish to use. You will need to add an administrator password to the file and potentially provide the location of your JDK 6 installation. The answer file will default to /usr/local, if you want it somewhere else you will also need to edit that line.
Then simply run the Glassfish installer by appending the -a ANSWER_FILE -s switches to the install command. Where ANSWER_FILE is your edited version of the answer file.
Hopefully that should get you going quickly.