pdf source code:
src.zip (4.4 KB)
origin pdf:
深圳市御港湾餐饮管理有限公司_发票金额244.00元.pdf.zip (117.3 KB)
image.png (294.5 KB)
In jdk1.7 environment,it converted success by aspose-pdf-24.6-jdk16.jar
image.png (312.5 KB)
In jdk1.7 environment,it converted error by aspose-pdf-25.6-jdk16.jar
error information:
Caused by: java.lang.UnsupportedClassVersionError: com/aspose/pdf/internal/l94n/l1t : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.aspose.pdf.l4v.(Unknown Source)
at com.aspose.pdf.License.setLicense(Unknown Source)
at com.landray.converter.executor.aspose.AbstractAsposeConverter.setLicense(AbstractAsposeConverter.java:40)
at com.landray.converter.executor.aspose.AsposePdfConverter.(AsposePdfConverter.java:27)
at com.landray.converter.executor.aspose.AsposeToHTMLConverter.doPdfConvert(AsposeToHTMLConverter.java:97)
at com.landray.converter.executor.aspose.AsposeToHTMLConverter.convert(AsposeToHTMLConverter.java:41)
at com.landray.converter.executor.AsposeExecutorMain.main(AsposeExecutorMain.java:68)
Please have a check and tell me how to solve it.
@hucq_landray_com_cn
The error you’re encountering, java.lang.UnsupportedClassVersionError
, indicates that the version of Java you’re using (JDK 1.7) is not compatible with the version of the Aspose.PDF library (25.6) you are trying to use. Specifically, the error message suggests that the library was compiled with a newer version of Java (Java 8 or higher), which is not supported by JDK 1.7.
Cause: The incompatibility arises because the Aspose.PDF library requires a Java version that is higher than what you currently have installed.
Solution: You have two options to resolve this issue:
-
Upgrade Your Java Version: The simplest solution is to upgrade your Java environment to at least JDK 8. This will allow you to use the newer version of the Aspose.PDF library without encountering compatibility issues.
-
Use an Older Version of Aspose.PDF: If upgrading Java is not feasible, you can continue using the older version of the Aspose.PDF library (24.6) that is compatible with JDK 1.7. However, keep in mind that you may miss out on new features and bug fixes available in the later versions.
Next Steps:
- Verify your current Java version using
java -version
.
- If you decide to upgrade, download and install JDK 8 or higher from the official Oracle website or OpenJDK.
- If you choose to stick with the older library, ensure that your project references the correct version (24.6).
Please let me know if you need further assistance!
aspose-pdf-25.6-jdk16.jar was compiled with JDK 1.6,if u dont support jdk1.6/jdk1.7,why use jdk1.6/jdk1.7 to compile?
@hucq_landray_com_cn
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFJAVA-45323
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.