简体   繁体   中英

how to recompile the 3rd party jars using lower version

I am stuck with an issue because of lower version of java. I am using eclipse, I set the compiler level to 1.5 version and using jars like

  1. ojdbc.jar
  2. jxl.jar

But its throwing the following error. So I am suspecting that the jars were compiled with higher version so may be thats the reason for this error.

java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main" 

Please someone let me know how to recompile 3rd party jars with lower version. Or any other solution or my issue.

jxl.jar was the culprit. may be the latest version was compiled on 1.7 + version

http://sourceforge.net/projects/jexcelapi/files/jexcelapi/2.6.9%20%28Java%201.4%29

I download this jar which was compiled with 1.4 version of java. so it will be safe on 1.5 version :) :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM