One possibility is to use Eclim. It is a powerful tool that can be used in many ways; in your case you would have to start a headless Eclipse server and basically use Eclipse's indexer etc. I think you need to have your project registered as an Eclipse project though.