Installing Glassfish on Linux

To install glassfish on linux is a good idea. So first of all download the latest build form the glassfish download page:

https://glassfish.dev.java.net/public/downloadsindex.html

To install and configure GlassFish you need to have JDK 5 or JDK 6 installed on your linux. Make sure that you have installed a JDK and not only a JRE (Java Runtime Environment) as this will be insufficient. You can check this first with the command:

 

 % java -version 

The installation is very easy as the download file include all necessary files.

  1. Download Glassfish into the directory the server should later run
  2. Run:
     % java -Xmx256m -jar filename.jar 
    This command will unbundle GlassFish and create a new directory structure rooted under a directory named 'glassfish'.
  3.  % cd glassfish 
  4. Set the execute permission for the Ant binaries that are included with the GlassFish bundle. If you have not the necessary permissions run the command as sudo (you have to put "sudo" before the command)
     % chmod -R +x lib/ant/bin 
     % lib/ant/bin/ant -f setup.xml 
  5. start the server using the asadmin command. For that be maybe you first have to change the current directory to /glassfish/bin.
     % asadmin Use "exit" to exit and "help" for online help. 
  6. next start the database
     asadmin> start-database 
  7. and finally you can start the server...
     asadmin> start-domain domain1 Starting Domain domain1, please wait..... 
  8. The server is now up and running. You can log into the web admin interface by the following url:
    http://localhost:4848
    Login as Admin - userid="admin", password ="adminadmin"


Tags