Creation of the object aspose.pdf licence problem

Hello,

I am working on a project using Aspose.Word and Aspose.Pdf

I have a problem when creating the Aspose.Pdf license object

Code2.PNG (4.2 KB)

Console.PNG (12.0 KB)

I find it strange because the first creation of a license object works just before for Aspose.Word,

I use the library aspose-words-18.10-jdk16.jar and aspose.pdf-18.10.jar

Can you help me?

Thank you.

@adardant

Thank you for contacting support.

Please try using aspose-pdf-18.11-jdk17.jar in your environment and then share your kind feedback with us.

Thank you for your answer.

I tried this with aspose-pdf-18.11-jdk17.jar and aspose-pdf-18.12-jdk17.jar and I have the same problem.

Can you help me?

Thank you very much.

@adardant

Would you please share a narrowed down sample application so that we may try to reproduce and investigate it in our environment.

I think my example can’t be more precise I sent you the exact line of code of the error,

it’s when creating the Pdf license object : “com.aspose.pdf.License()”

what I find strange is that creating a Word license object : “com.aspose.words.License()” works just before in the code with the same license

What more do you want to know?

@adardant

We are unable to reproduce it in our environment so we need your narrowed down sample application and environment details to reproduce and investigate it further.

We use the Aspose.Pdf and Aspose.Word libraries to create a document conversion program that is more appropriate to our needs. So we use it in java code, and the error appears directly when we call:
licensePdf = new com.aspose.pdf.License();
We then execute our code compiled in a Red Hat Enterprise Linux Server release 5.11 (Tikanga)

The error is :
Exception in thread “main” java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsupportedClassVersionError: com/aspose/pdf/License : Unsupported major.minor version 51.0

@adardant

Thank you for elaborating it further.

You are probably facing the exception because of incompatible JAR file. Please ensure using
aspose-pdf-18.12-jdk16.jar if you have JDK1.6 in your environment. For JDK1.7 please use aspose-pdf-18.12-jdk17.jar or aspose-pdf-18.12.jar for JDK1.8 and then share your kind feedback with us.

It works !

I’m so sorry ! Thank you very much !