Mac OS X 10.6 Snow Leopard comes with the 64bit version of Java 1.6 installed by default. Unfortunately, Eclipse 32bit and older subeclipse plugins are not 100% compatible with the 64bit version of Java 1.6. You may encounter errors when using Eclipse such as “Unable to load default SVN client” (which can be solved by installing JavaHL), and an unknown exception when creating a “project from svn” (you’ll need Eclipse 64bit to fix this). The best, simplest solution is to get the latest version of Eclipse Cocoa 64bit for Mac OS X, codenamed Galileo.
Installing JavaHL Library (Pre-requiste for Subclipse)
In order for subclipse to work on your Mac OS X machine, you will need to download and install the JavaHL which provides a JNI binding layer from Java to the subversion binaries. The quickest way is to just install the latest subversion binaries, which includes the JavaHL library.
- Double-check what is installed on your Mac OS X by opening a Terminal and running the following:
The last should show a symbolic link to the JavaHL library if you have a version installed.
- To install the latest subversion and JavaHL, go to Collabnet Website.
- Select the appropriate subversion binaries for your Mac OS X version; currently “Subversion 1.6.9 Universal”.
- You can leave the contact info form blank and just hit the Submit button to download the .dmg image (ex: Subversion-1.6.9-10.6.x.dmg)
- Check that the /opt directory (which is a symbolic link to “/private/opt”) exists. If not, you can create it by running this command:
sudo ln -s /private/opt /opt
- Launch the .dmg image and double-click on the subversion icon to install the binaries into the default “/opt/subversion” directory.
- Once installed, you will need to prepend “/opt/subversion/bin” to your PATH environment variable. Open up your bash environment profile “~/.profile” and add this line:
Note that the path separator is a colon, not a semi-colon (used by Windows).
- Double-check that the JavaHL library is accessible. You should find a symbolic link (ex: “libsvnjavahl-1.jnilib”) for the JavaHL library in the “/Library/Java/Extensions” directory. This is the global location that the Mac OS X JVM will look for when loading libraries via JNI.
Install Eclipse Cocoa 64bit
- Get the Mac OS X Cocoa 64bit version of Eclipse.
- Go to the Eclipse Downloads page.
- Find “Eclipse IDE for Java Developers” and click on the Mac Cocoa 64bit link to the right.
- Unzip the downloaded .gz archive and copy the resulting expanded eclipse directory to your /Applications directory.
- Go to the “/Applications/eclipse” directory and run the “eclipse” program.
- Install Subclipse for Subversion integration
- Go to Eclipse menu Help->Install New Software…
- Input “http://subclipse.tigris.org/update_1.6.x” into the “Work with” field and the table will be updated with installation packages available at that location.
- Check just the Subclipse package and keep clicking Next until the end. Half-way through, you will be asked to accept the license agreement.
- If you wish Eclipse to remember the URL, hit the Add button and name it “Subclipse”.
- Install PHPEclipse, also known as PHP Development Tool (PDT), for PHP Development
- Input “http://update.phpeclipse.net/update/stable/1.2.x” (evidently, “http://phpeclipse.sourceforge.net/update/stable/1.2.x/” is the same URL) into the “Work with” field.
- Just pick PHPEclipse. If you want to debug, install DBG or XDebug. (I haven’t tried XDebug yet so I can’t recommend DBG over it.)
- JSDT is a part of the Eclipse Web Tools Platform (WTP) repository. Input “http://download.eclipse.org/webtools/updates” into the “Work with” field.
- Locate (but don’t check) the latest WTP (Web Tools Platform); currently “Web Tools Platform (WTP) 3.1.2”.
- Click on the right-facing arrow (to the immediate right of the checkbox) to expand the packages inside the WTP.
Uninstalling Subversion and Eclipse
- To uninstall Subversion, just remove the “/opt/subversion” directory, remove the /Library/Receipts/Subversion-1.6.9.pkg directory, and delete the JavaHL symbolic link at “/Library/Java/Extensions/libsvnjavahl-1.jnilib”.
- To uninstall Eclipse, just remove the “/Applications/eclipse” directory.