Nov 23, 2009

Mac OS X Development Hurdles

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 JAVA_HOME=`/usr/libexec/java_home`

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 php5_module 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.

About the Author

Object Partners profile.

One thought on “Mac OS X Development Hurdles

  1. Eric Foster-Johnson says:

    Excellent write-up.
    Thanks,
    -Eric

Leave a Reply

Your email address will not be published.

Related Blog Posts
Building Better Data Visualization Experiences: Part 1 of 2
Through direct experience with data scientists, business analysts, lab technicians, as well as other UX professionals, I have found that we need a better understanding of the people who will be using our data visualization products in order to build them. Creating a product utilizing data with the goal of providing insight is fundamentally different from a typical user-centric web experience, although traditional UX process methods can help.
Kafka Schema Evolution With Java Spring Boot and Protobuf
In this blog I will be demonstrating Kafka schema evolution with Java, Spring Boot and Protobuf.  This app is for tutorial purposes, so there will be instances where a refactor could happen. I tried to […]
Redis Bitmaps: Storing state in small places
Redis is a popular open source in-memory data store that supports all kinds of abstract data structures. In this post and in an accompanying example Java project, I am going to explore two great use […]
Let’s build a WordPress & Kernel updated AMI with Packer
First, let’s start with What is an AMI? An Amazon Machine Image (AMI) is a master image for the creation of virtual servers in an AWS environment. The machine images are like templates that are configured with […]