@Ninja pointed me in the right direction but I'll post the detailed steps here.
Short answer: You need version 19 or higher of the Android toolchain, as that version introduced the Java 7 support needed to build against the prebuilt Mapsforge 0.4.0 libraries.
How to update:
- Start ADT. Update all installed packages and additionally select at least one version of Android SDK Build-tools that is 19 or higher. (You can have multiple versions of the Android SDK Build-tools installed alongside each other.)
- Now open Eclipse and select Help > Check for Updates from the menu.
- If you get an error message that no software sources are available, go to Help > Install new software. In the dialog, click Add and add a new repository named ADT Plugin, URL https://dl-ssl.google.com/android/eclipse/. Then retry.
- Restart Eclipse when prompted to do so.
- Setting the compiler compliance level turned out not to be necessary in my case (I left it at 1.6).
With these steps my Mapsforge project works – I can display a map and the NoClassDefFoundError
is gone.