So I donwloaded the ignition library, built with Maven and imported as a project into eclipse.

However, all the libraries and sample code have a red exclamation mark in front of project name, and they do not compile. The "Problems" console shows that there are some problems with Build Path, and there are a lot of "Unbound classpath variable: 'M2_REPO'..." entries.
I see they point to some jar files.

Please tell me how can I get rid of these errors and fix the projects so they compile?

2 Answers
2

It looks like your use classic way import project into workspace (File -> Import ... -> General -> Existing Projects into Workspace), if I recall, this is the reason why Eclipse asking for a fixed-name classpath varlable M2_REPO.

If the Android project is properly mavenized, you should install two Eclipse plugins (m2e & m2e-android) and import project as a maven project (File -> Import ... -> Maven -> Existing Maven Projects), this does not require classpath vaiable M2_REPO.

After doing this, you will probably need to run mvn eclipse:clean and eclipse:eclipse in the project directory to rebuild the Eclipse-specific files (.settings, .classpath, .project) and refresh the project files in Eclipse before trying to build in Eclipse again. This worked for me.
– hotshot309Jul 12 '12 at 19:49