Month: April 2008

Erlang on Mac OSX

April 28, 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:

$ cd otp_src_R12B-2
$. /configure
$ make
$ sudo make install

Now bring up a terminal and issue the command:

$ erl

Erlang (BEAM) emulator version 5.6.2  [smp:2] [async-threads:0] [kernel-poll:false]
Eshell V5.6.2  (abort with ^G)
1>2+3.
5
2>;

I am all set to go…

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