Category Archives: OSX

Setting Eclipse and Java application JVM heap size on Mac OS X

The other day I kept on getting annoying “out of heap space” errors in Eclipse while running a memory intensive Java application I had written and it took a bit of searching to find the answer, so I thought I’d make a quick screencast that demonstrates how to increase the heap size of the JVM that Eclipse uses as well as how to increase the heap size allocated to your Java applications by Eclipse.

screecast thumbnail

This screencast is also available in podcast format for video iPods.

subscribe with itunes

Setting Mac / Unix Environment Variables – Adding Executables to the System Path

After years of resistance I finally caved and bought a sleek, shiny MacBook Pro over the weekend. I’ve been slowly figuring out how to set up my AMES development environment and that means figuring out the basics of using the Unix shell. I struggled to find a simple explanation of how to set environment variables, so I’m inserting a couple of screen grabs which illustrate how to add MTASC and Swfmill to the PATH environment variable.

I downloaded, unzipped and placed the mtasc and swfmill binaries in their respective folders in the following folder:
/usr/local/bin
Method 1 : A Session Variable – Using the bash shell, this adds the mtasc and swfmill binaries to the PATH variable for the current terminal session. When you close the shell and reopen it, you’ll have to add the files to the PATH variable again.

There’s actually a typo in the screen grab–it should be:

export PATH=$PATH:/usr/local/bin/mtasc:/usr/local/bin/swfmill

Method 2: Add to Startup Script – Place the command in a startup script called bashrc which can be found along the path below. The modified PATH will always be available to any bash shell and no further editing is needed.
/etc

This method is similar to how environment variables are set in Windows (without the gui absraction layer). the bashrc file is a simple text file and you simply add the commands to this script which is run everytime the os loads.

I can now reference mtasc or swfmill in the bash sell by simply typing the executable name!Since, I opted for the “set it and forget it” method, I know I at least will benefit from having something to reference the next time I have to set up OSX or Linux (I vaguely remember doing this when I first forayed into Linux a year ago and cursed my laziness at not writing down the process)….maybe there are others out there who have shared the pain of leaving their comfortable Windows double-wide trailer and gone hollywood with the glamorous mac-villa “Made by Apple in California” :)