Wednesday, 31 July 2013

Installing GlassFish application server in Ubuntu Linux

In this article, we will see how to install, setup and run GlassFish  JEE application server in Ubuntu 12.04.

1. Download GlassFish application server

You can download GlassFish application server from here

2. Setup JDK 7

GlasshFish 4 requires JDK7. So you need to setup JDK 7. In order to setup JDK7, please follow the article here.

3. Extract the downloaded GlassFish application server


Terminal
$unzip glassfish-4.0.zip


Now a directory called glassfish4 will be created in the current directory

4. Set PATH environment variable to GlassFish application server

Add given below lines to the file <user-home-directory>/.bashrc . The '.bashrc' is a script file which will be executed whenever a terminal is opened up in Ubuntu.

Terminal
PATH=$PATH:/path/to/glassfish4/bin

export PATH


5. Run the file .bashrc to make it effect immediately

File : .bashrc
$ . ~/.bashrc


6. Start GlassFish application server

Terminal
$asadmin start-domain

By default GlassFish application server will be started in the port 4848.

7. Screenshot of the homepage of the application server

You can access the home page of the application server at http://localhost:4848

Screenshot of the GlassFish 4 Application Server Home Page



8. Stop GlassFish application server

Terminal
$asadmin stop-domain