New to Eclipse and Solr, I imported apache-solr-3.6.0.war into Eclipse and run Solr with tomcat plugin. Now i want to debug some existing code, however how do i import the Solr source code?
Without knowing how you imported it exactly: sounds like you are looking for Source attachment .
It might be better if you use the Solr source code directly. Check the README file included in the release, there is an ant task to init eclipse:
To setup your ide run [...] 'ant eclipse'.
Then all dependencies are loaded using ivy and you can run it from within the IDE.
You can also check out the whole Lucene/Solr source:
New...
> Project...
SVN
> Checkout projects from SVN...
/branches/lucene_solr_3_6
(if you want last stable version. Use trunk if you want to use cutting edge source)Check out as a project in a workspace
and leave everything else defaultThen, after the checkout completes, to complete setup, you don't have to fiddle with JARs manually, simply:
build.xml
, the one in your project's rootRun As...
> Ant build...
select (in this order)ivy-bootstrap
and resolve
tasks (which will download all JAR dependencies) validate, clean-idea, eclipse, compile, get-maven-poms, generate-maven-artifacts
(the last two only if you plan to use Maven).And that's it, you should now see no redness in your workspace and have Lucene and Solr JARs built.
Run solr like this:
java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1044 start.jar
Solr will start, but wait you to connect from Eclipse to continue.
Then in Eclipse, go to:
This is the standard way to debug remote applications in Java
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.