Mac OS X Development Hurdles

Moving to Mac OS X as a development environment and some issues or differences discovered..

Object Partners

The Mac is popular, there’s no doubt about it. So after years of development with Windows and Linux, I finally got the chance to develop with a new MacBook Pro Snow Leopard. Although things have been fairly smooth, I did run into quite a few hurdles and difficulties figuring out how to do some of the mundane daily tasks on this shiny little beauty. I’m not saying one is better than the other, but they’re just different (especially being so used to developing on a Windows or Linux laptop). With all my trials and tribulations I went though, I figured others ran into similar issues more than likely . So following is a list of the differences that took me the longest to track down, and the ones I need to reference periodically.

Environment Variables

  • Programs running in Terminal reference variables defined in ~/.profile
  • Applications get variables from ~/.MacOSX/environment.plist

Java

  • The Java version is set in Applications/Utilities/Java Preferences.app
  • Set your Java Preference for apps running in terminal by adding this line to your ~/.profile _export JAVAHOME=`/usr/libexec/javahome`_

Apache Apache may be the same for Linux as the Mac. When I was developing with a Linux box I installed Apache in it’s own directory and didn’t use the default locations.

  • To start apache, go to System Preferences, Sharing, click Web Sharing
  • apachectl is located in /usr/sbin
  • Log files are in /var/log/apache2
  • Config files are in /etc/apache2
  • Pages are stored in 2 locations

    • Global pages are stored in /Library/WebServer/Documents
    • Personal pages are stored in /Users/yourname/Sites/
  • View pages at http://localhost
  • View personal pages at http://localhost/~yourname/

PHP

  • php.ini needs to be created in /etc
  • /etc/php.ini.default can be copied to php.ini
  • Uncomment the _LoadModule php5module\ in /etc/apache2/httpd.conf file

MySQL

  • In /etc/hostconfig MYSQLCOM=-YES- starts MySQL automatically.
  • The start script is /Library/StartupItems/MySQLCOM/MySQLCOM start but only works if hostconfig is set to yes.
  • I copied the MySQL start script into /Users/~yourname/scripts and removed the MySQLCOM checking so I can start/stop MySQL at will

Oracle Good luck. Oracle is not available for the Mac. Your best bet is to install a Windows or Linux Virtual Machine and run Oracle inside of that.

Overall, the difficulties I experienced were trivial and would not prevent me from recommending Mac OS X to anyone interested in switching to a new development environment. I’m sure the future will bring plenty of other nuances and work arounds for the Macbook, but I’m very happy I had the opportunity to switch development environments and continue to enjoy developing with it. I think we typically all despise change and that conventional adjustment period, but hopefully these tips will reduce the time it takes for you to become productive with the switch.

Share this Post

Related Blog Posts

JVM

Default settings of svn:keywords property

October 28th, 2009

Keyword expansion is not the default for files added to an SVN repository.  And it’s done on a per file basis (with CVS we could configure an entire repository to turn on keyword expansion — .)  Some svn tools and plugins allow for defaulting…

Object Partners
JVM

Delivering Business Value Through Polyglot Systems (part 4 / conclusion)

September 21st, 2009

In my previous three posts, I described my experience with maintenance, refactoring, and installation on a large project that used both Java and Groovy. In this post, I will discuss the “support nightmare” raised by Bill Burke in his blog post…

Object Partners
JVM

Delivering Business Value Through Polyglot Systems (part 3)

August 26th, 2009

In my previous two posts, I described my experience with maintenance and refactoring on a large project that used both Java and Groovy. In this post, I will discuss the installation concerns raised by Bill Burke in his blog post “Polyglot…

Object Partners

About the author