Reputation: 20420
I've updated Dropbox API framework from 2.0.1 to current 3.1.2 in my android app. While packing my app i'm getting multiple errors like:
[INFO] trouble processing: [INFO] bad class file magic (cafebabe) or version (0033.0000) [INFO] ...while parsing com/dropbox/sync/android/DbxStringValue.class [INFO] ...while processing com/dropbox/sync/android/DbxStringValue.class [INFO]
It seems that files are compiled by jdk 1.7 but i'm still using jdk 1.6 and i would not like to update to jdk 1.7 (to avoid new bugs and incompatibilities).
How to convert .jar 1.7 to .jar 1.6?
Upvotes: 0
Views: 2903
Reputation: 417757
If the jar already contains classes compiled with and targeting Java 7.0, chances are that the classes use features only available in Java 7.0 in which case you won't be able to convert it (unless you relace the codes using Java 7.0 only features codes).
If you're lucky and the classes were just compiled and targeted with Java 7.0 but they don't actually use any new features introduced in Java 7.0, you can use a Java decompiler to acquire Java source files from your jar, recompile it with Java 6.0, repack and you're done.
For decompiling .class
files to .java
files you can use the JD Project or goole any other alternatives.
A few more options:
But best and easiest would be to just upgrade to Java 7.0. You'll gain much more than you lose (if you even lose anything).
Upvotes: 2