Android SDK requirements state that either JDK 5 or JDK 6 is required.
However, I have a Java class library written in Java 7 and I would like to use it for my Android project.
Instead of manually converting Java 7 to Java 6 by hand, I was wondering if anyone know of a converter that could do this job for me?
Or do we have to code one up from scratch?
The backwards compatibility means that you can run Java 7 program on Java 8 runtime, not the other way around. There are several reasons for that: Bytecode is versioned and JVM checks if it supports the version it finds in . class files.
Do you have the source for the JAR? If so, you can use the javac -target
parameter set to either 5 or 6 to generate either Java 5 or 6 class files. See this page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With