Tag: Flassfish on Mac OSX

Glassfish on Mac OS X

April 16, 2008

I just tried Glassfish on Mac and everything turned out very smoothly. Here us how I did it:

1. Glassfish requires at least JDK5 or above. I already have J2SE from apple. If you already don’t have it, get an update from apple

2. Get the latest Mac OS build of Glassfish which is a self-extracting jar named like glassfish-installer-v2ur1-b09d-darwin.jar

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

$ env

7. Now start the server using the command:

$ asadmin start-domain domain1

To confirm that the server is running, go to http://localhost:8080

You can go to the admin console at http://localhost:4848