3. Move to jar to wherever you want to install Glassish. (I moved mine inside the Documents folder.) Go to the location of the jar file from the terminal and issue the command:

$ java -Xmx256m -jar filename.jar

It will unbundle the jar file, and put the directory structure inside a newly created directory Glassfish.

4. cd inside the Glassfish directory.

$ cd glassfish

5. Now you need to run the set up script. Glassfish bundle comes with ant binaries. Set the permission of the ant binaries and run the set up script.

$ chmod -R +x lib/ant/bin$ lib/ant/bin/ant -f setup.xml

Now that Glassfish is installed and set up, you need to start the server.

6. In order to use the asadmin command, set the PATH to INSTALL_DIR/bin, where INSTALL_DIR is the path where it you created your Glassfish installation directory. You can set the PATH from the terminal:

$ echo 'export PATH=xyz:$PATH' >> ~/.bash_profile

where $PATH= INSTALL_DIR/bin
You can open up another terminal and see if the PATH is set by using the command