Getting started with Eclipse

This short guide describes how to start working with JavaNLP in Eclipse.

Make sure your path is set correctly

Follow the SVN setup instructions at the start of the SVN guide. If all is well, you should be able to run the following command on your local machine:

  ssh username@jamie.stanford.edu which svnserve

And get the following output:

  /u/nlp/bin/svnserve

If not, the rest of these instructions won't help.

Download and Install Eclipse

Install the most recent version of Eclipse from the Eclipse download site. Either the "Eclipse IDE for Java Developers" or the "Eclipse Classic" should be fine.

Configure Secret Eclipse Options

It is generally a good idea to give Eclipse more memory when it runs, by launching it with the command

  eclipse -vm /path/to/java -vmargs -Xmx1400M -XX:MaxPermSize=384M
If you don't want to have to launch eclipse from the command line each time, you can add these same flags to your eclipse.ini file. For more information, see the eclipse documenation or this collection of eclipse tips (the bottom-most tip in particular).

Install subversion plugin for Eclipse

NB: If you already have Eclipse, I recommend you delete your existing installation and workspace [make a backup first!]. Then download a fresh new build and start with a fresh new workspace before proceeding. It might or might not work if you don't.

Subversion support is not currently included with Eclipse by default, but there are stable plugins that do the job.

Install the Subversive plugin by following the instructions linked from the Eclipse Subversive Download site. You'll need to add two software update paths, one for the team plugin, one for the connector libraries. Make sure to install the "SVNKit" SVN Connector library (stable version).

Check out JavaNLP -- Linux, Mac, Cygwin

This configuration allows you to go back and forth between editing and compiling at the command line with ant and using eclipse for just the projects you care about. It is the recommended configuration if you have the "svn" command available at the command prompt.

  1. From the command line, check out javanlp to somewhere NOT in your eclipse workspace with:
    svn co svn+ssh://username@jacob.stanford.edu/u/nlp/svnroot/trunk/javanlp
  2. Go into eclipse and choose File->Import->Existing Projects into Workspace. Navigate to your external javanlp checkout's projects folder and select each project folder that you care about individually for importing (but be sure to uncheck "Copy projects into workspace.")

You now have each project you care about in eclipse, referencing each other. Each of these projects exists in the independent checkout directory outside of eclipse's workspace. You can navigate to that folder and manipulate it directly with emacs/svn etc -- just make sure you "refresh" the project next time you're in eclipse.

Check out JavaNLP -- Unsupported alternative configuration

Alternatively, you can check out JavaNLP directly from within Eclipse, but different people have more or less success with this method.

  1. Switch to the newly installed SVN Repository Exploring perspective.
  2. File -> New -> Repository Location
  3. Set the Root URL to be
    svn+ssh://jamie.stanford.edu/u/nlp/svnroot/
  4. Enter your username and (if you want) your password. I have been unable to get the plugin to use my ~/.ssh/id_rsa.pub.
  5. Browse into the new location through trunk/javanlp/projects. Right-click on core and choose "Check Out". Repeat for any other projects you need.

You should now have a fully configured JavaNLP checkout waiting in the Java perspective!

JavaNLP coding conventions: tabs and spaces

To be in accord with the JavaNLP coding conventions, Eclipse must be configured to indent with two spaces always (and never tabs).

  1. Right-click on the JavaNLP project in the Java perspective and choose Properties -> Java Code Style -> Formatter.
  2. Check "Enable project specific settings". Click "New" and create a profile named "JavaNLP" based on the "Eclipse [built-in]."
  3. On the "Indentation" tab, choose "Spaces only" as the tab policy. Set both "indentation size" and "tab size" to 2.
Darbar.

Contact: Daniel Ramage