Programming

JAVA_HOME on Mac OS X

Posted in Apple, Programming on October 8th, 2009 by joecrow – Be the first to comment

I was working on configuring HBase to run on my Mac OS X machine, and I ran into a hiccup setting up the JAVA_HOME environment variable. Eventually, I determined that there’s a “Home” directory inside of each Java Framework. So, the full command is is:

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

Aliases and colorful ls in Mac OS X

Posted in Programming on June 20th, 2009 by joecrow – Be the first to comment

At work, we use svn as a code repository and svnmerge for branch management.  A coworker who recently switched to Mac asked me how he could assign a global variable so that he could run the svnmerge command without specifying the full path to the python script.  The solution was to add an alias to svnmerge that is loaded on shell startup.  Since Mac OS X uses the bash shell, he needed to add the following to his .profile file (the .profile file sits in the home directory and can be created if it doesn’t yet exist):

alias svnmerge='/path/to/svnmerge.py'

The svnmerge.py file also needs to be executable (chmod a+x svnmerge.py).  The changes will take effect the next time you open a new shell.

While I’m at it, it’s worth mentioning another useful option that I have in my .profile file.  By adding export CLICOLOR=1, the ls command will output in color to distinguish between directories, files, and executables.