Month: April 2008

On a fresh install of Leopard, the following is what I did in order to set up Erlang working on my Mackbook Pro:

1. Download Xcode by going to Apple ADC. Xcode is the Apple’s developer tool set, and its available for free. At the time of my install, the latest is Xcode 3.0 and its little over 1 GB. Double-click the downloaded file (named xcode_3.0.dmg), and follow the graphic package installer. This will install Xcode under /Developer by default. This step is required for Erlang because it will install GCC compiler required to build Erlang from source.

2. Get the latest Erlang source, which will be a file named otp_src_R12B-2.tar. Unarchive the file and follow the instructions:

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