Setup Dagger with Eclipse


The dependency injection library Dagger by Square setup for using it with Eclipse is a bit different when not using Maven.

At the time of writing, there seem to be no complete explaination on what is needed to setup everything. I got everything working with combined information from the comments in issue 126 by staxgr and arichiardi.

  • Prepare the Eclipse project and create the directories libs and libs-compile.

  • Download the following libraries:

  • Enable Annotation Processing and add all four libraries to the factory path of the annotation processing settings

    • Project Properties → Java Compiler → Annotation Processing
      • check “Enable project specific settings” and “Enable annotation processing”
    •  Project Properties → Java Compiler → Annotation Processing → Factory Path
      • “Add JARs…” for each downloaded jar

When starting a build, the generated files should appear in .apt_generated. This directory should be automatically configured as a source folder after annotation processing has Bern enabled.