I am using the ADT version 21 plugin for Eclipse, and I am programming for the Android 4.2 platform. I originally wrote a Java client-server application, and I want to use some of the classes that I wrote in it for an Android application that I am writing right now. I tried exporting the Java class files to a JAR file and putting the JAR file in the libs
directory in my Android application, but when I tried to run the application on my Nexus 4, a NoClassDefFoundError
is thrown. I searched SO for some answers and tried a few suggestions such as including the JAR file in the Order and Export tab in the Properties window (and putting it at the top of the list), but I'm stuck. Eclipse compiles my Android application fine, but I am unable to run my application on my device.
I know this question has been asked before, and several users have experienced this same issue. I welcome all suggestions. (I just started learning about Android application development.) Thanks!
EDIT: I just noticed these lines in the Console output. Any ideas?
[2012-11-24 01:26:26 - HomePage] Dx bad class file magic (cafebabe) or version (0033.0000)
...while parsing org/nihongo/common/db/Commands.class
...while processing org/nihongo/common/db/Commands.class
EDIT: I think it could be the fact that I am using Java 7 instead of Java 6. See here.