Installing the JavaHL SVN connector in Zend Studio for Eclipse

Overview

The SVN functionality in Java programs is available with two connectors:

  • SVNKit (formerly known as JavaSVN) – is the default connector in Zend Studio for Eclipse. It is pure Java implementation of the Subversion API.
  • JavaHL – uses JNI to execute operating system's native binary libraries for SVN operations.

In some cases JavaHL may be a better choice than the default SVNKit connector. This article describes how to add the JavaHL SVN connector to Zend Studio for Eclipse. The process consists of the JavaHL Eclipse plugin installation and operating system's configuration.

Note:
This article was prepared using Zend Studio for Eclipse 6.1.1. Plugin versions and paths, specified in this article, will be different for the other version of Zend Studio for Eclipse.

Instructions

Installing the Subversive JavaHL Connector Plug-In

  1. In Zend Studio for Eclipse, go to Help | Software Updates | Find and Install.
  2. In the Feature Updates dialog, select the second option Search for new features to install and click Next.
  3. In the Update sites to visit dialog, select the Subversive SVN connectors update site 2.0.x and click Finish (you may want to check the Automatically select mirrors checkbox before clicking Finish, in order to skip the mirror selection prompt).
  4. In the Search Results dialog, open the hierarchy Subversive SVN connectors update site 2.0.x | Subversive SVN Connectors.
  5. Mark the Native JavaHL 1.5 Implementation plugin.
Windows Note:
Microsoft Windows users also need to mark the JavaHL 1.5.4 Win32 Binaries plugin.
  1. Click Next and complete the installation by accepting the defaults in the dialogs to follow.
  2. Restart Zend Studio for Eclipse.
  3. Go to Help | Software Updates | Manage configuration.
  4. Find the SVNKit 1.1.7 Implementation and SVNKit 1.2.1 Implementation plugins, right-click each and choose Disable.
  5. Restart Zend Studio for Eclipse.

Configuring JavaHL Support in Microsoft Windows

No additional steps need to be taken by Microsoft Windows users, except for step 5 in the previous section.

Configuring JavaHL Support in GNU/Linux

On a GNU/Linux system the JavaHL plug-in expects to find the libsvnjavahl-1 library. This library must be installed in the operating system and its path must be listed in JRE's 'java.library.path' parameter.

  1. Search you distribution's documentation for help on installing the libsvnjavahl-1 library. Examples:

     

    • Debian (Ubuntu) users need to install the libsvn-java package ( # aptitude install libsvn-java )
    • Fedora users need to install the subversion-javahl package ( # yum install subversion-javahl )
  2. Install the required libraries.
  3. To add the newly installed library to the java.library.path parameter of the JRE, choose either of the following methods:

     

    • Follow the instructions in the Knowledge Base article "How to Change the JRE Used by Zend Studio for Eclipse", which describe how to run Zend Studio with the system's JRE. This automatically adds the system's library paths into the Java environment
      OR
    • In Zend Studio:

       

      1. Open the Configuration Details – Help | About Zend Studio for Eclipse | Configuration Details.
      2. Find the java.library.path parameter and copy its value.
      3. Open the ZendStudio.ini file ( < Zend Studio installation directory >/ZendStudio.ini ).
      4. Right after the '-vmargs' parameter add -Djava.library.path=<the line copied from Zend Studio Configuration Details>:/usr/lib. Note that the path to libsvnjavahl-1 can be different for your distribution (not /usr/lib). The resulting file should look like this:
–launcher.XXMaxPermSize
256m
-startup
plugins/org.zend.php.startup_1.0.0.jar
-vmargs
-Djava.library.path=/usr/local/Zend/ZendStudioForEclipse-6.1.1/jre/lib/i386/client:/usr/local/Zend/ZendStudioForEclipse-6.1.1/jre/lib/i386:/usr/lib/xulrunner-1.9.0.5:/usr/lib/xulrunner-1.9.0.5:/usr/lib/xulrunner-1.9.0.5:/usr/lib
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/local/Zend/ZendStudioForEclipse-6.1.1/plugins/org.mozilla.xulrunner.gtk.linux.x86_1.8.1.3-20070404/xulrunner
-Xms128M
-Xmx512M

Configuring JavaHL Support in MacOS X

The process is similar to the one used for GNU/Linux:

  1. Install subversion-javahlbindings using MacPorts.
  2. In Zend Studio, open the Configuration Details – Zend Studio for Eclipse | About Zend Studio for Eclipse | Configuration Details.
  3. Find the java.library.path parameter and copy its value.
  4. Open the ZendStudio.ini file ( < Zend Studio installation directory >/ZendStudio.app/Contents/MacOS/ZendStudio.ini ).
  5. Right after the '-vmargs' parameter add -Djava.library.path=<the line copied from Zend Studio Configuration Details>:/opt/local/lib. The resulting file should look like this:
-showsplash
org.eclipse.platform
-vmargs
-Djava.library.path=.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:/opt/local/lib
-Dorg.eclipse.swt.browser.XULRunnerPath=/Applications/Zend/Zend Studio for Eclipse – 6.1.1/plugins/org.mozilla.xulrunner.carbon.macosx_1.8.1.3-20070404/xulrunner
-Xdock:icon=../Resources/mac.icns
-XstartOnFirstThread
-Xms40m
-Xmx256m
-XX:MaxPermSize=256m
-Dorg.eclipse.swt.internal.carbon.smallFonts

Result

To verify that JavaHL was installed properly:

  1. Start Zend Studio for Eclipse.
  2. Open the Preferences dialog – go to Window | Preferences, Team | SVN (on MacOS – Zend Studio for Eclipse | Preferences, Team | SVN).
  3. Switch to the SVN Connector tab.
  4. You should be able to see the Native JavaHL connector selected in the drop-down.

Now you can try performing your regular SVN operations and decide whether JavaHL is a better choice for you.