Reputation: 7890
I've created a small JAR library in Netbeans containing a few non-platform specific classes and interfaces. I then use this JAR file in an Android Eclipse project by placing it in the libs
folder. I can then import any class or interface into the android code with no problem. I can also extend the Android View class and implement an interface contained with the JAR file and this custom View is displayed in the Layout editor (in Eclipse) with no problem.
The problem comes when I attempt to run the app on the Emulator. It crashes and logcat gives a NoClassDefFoundError
, complaining that it cannot resolve classes which are in the JAR file despite me including it in the build path.
I originally built the JAR file targeting JDK 1.7 but I happened to try changing it to JDK 1.6 and then the app works.
Has anyone else come across this? Is JDK 1.7 incompatible with Android?
javac -version
reports 1.7.0_17
Upvotes: 0
Views: 188