Java: is there a way to make the code (in a third-party JAR) compatible with the transition (1.4 - 1.6)

I have a third-party JAR file that compiled using Java 1.4. Is there a tool that can make a jar file compatible with Java 1.6? (Something like a "repeater," but vice versa). I tried to decompile class files and recompile them in version 1.6, but this fails.


Here is the problem:

My project uses "rsadapter.jar" for 5.1, and I had my project setup in Eclipse 2.0 + JDK 1.4, and it worked fine. Now I switched to Java 1.6 and Eclipse Ganymede (as per requirements), and the same project (exactly the same setup) started complaining about missing class files in "rsadapter.jar". I also put the JAR in the classpath, but it still could not load classes. Then I changed the Java compiler version to 1.4 and started working.

Regards,
Ashish

+1
source share
3 answers

Classes compiled by JDK 1.4 should be used in Java 6 as-is. If you really encounter a problem, describe it.


. " " ( ). , ? , JDK, .


. , , . , , .

JDK 1.4.2_19 Java 6 Eclipse. , - . Eclipse ( JDK, , ) , , .

+5

, Java 1.4.x: . . Java 1.5 ( ).

, .

+1

Maybe you defined Eclipse to throw compiler errors when using obsolete methods or classes?

0
source

Source: https://habr.com/ru/post/1723850/


All Articles