How do I use libraries compiled for Java 7 in Java 6?
I'm developing a Java application and I need to use one called mybeans Jar
This mybeans@ R_ 419_ 2267 @ contains many class files compiled with JDK 1.7 I don't have the source code for these class files
My entire application uses JDK 1.6 I can't change its compiler to JDK 1.7 So I want my jar to be compatible with my application This is why I want to compile jar classes with JDK 1.6
Now my question is: is there any way to compile class files (& not java files) using JDK 1.6?
Any other suggestions are also welcome
It was suggested that I use a decompiler and amplifier to get the source code from the class file Then compile the source code with JDK 1.6 But I will like this solution in the end because there are many class files
Solution
This may not work Java 7 introduces language features that do not exist in earlier versions, so if you use any of them in the library, you may not be able to recompile using JDK 6
In addition, each Java revision introduces new methods and classes, so if @ since 1.7 items are used in the library, they will not appear in the Java 6 environment and the build will fail