Eclipse (Galileo, J2EE version 1.2.2.20100217-2310, but any relatively recent Eclipse should do):

Checkout the trunk with subclipse (location: https://svn.apache.org/repos/asf/lucene/dev/trunk), then run 'ant eclipse' and refresh your project.

If you don't have a project yet to refresh, click File>>New>>Java Project. Uncheck "use default location", and navigate to "solr home" and just open that. It'll churn for a while, but it'll get there in the end. At that point you should be able to right-click on one of the test cases and run a Junit test, but see the "-ea" notes below.

Remote debugging

First, start up your server (here I'm using the default Jetty server) and start it with these options:

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7666 -jar start.jar

"address" is the port you're going to attach to, the port you use is arbitrary. Now, in Eclipse hit the little down arrow next to the cute little bug icon and then "debug configurations>>remote java applications" and click the "new" icon in the upper left. Name your project and put the port in that corresponds to the "address" above.

You should now be able to set breakpoints etc. when you run this configuration.

Enabling Assertions for unit tests in Eclipse

By default, Eclipse does not run test with assertions enabled. This causes some tests to run incorrectly in Eclipse and excludes some checks in the source code.

Change this by checking the box "Add '-ea' to VM arguments when creating a new JUnit launch configuration".

This checkbox is available under Windows>Preferences>Java>JUnit

Tips

Running SOLR in Eclipse, Solr-1.4 Sept. 2009, see: http://lucidworks.com/blog/setting-up-apache-solr-in-eclipse/