Cannot initialize a Workbook on Solaris

I'm using Aspose.Cells for java 11.10.0 for jdk6 and I'm trying to create a Workbook:

Workbook workbook = new Workbook();

but I'm getting the following exception when running then code on Solaris:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.awt.GraphicsEnvironment.createGE(Unknown Source)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
at java.awt.image.BufferedImage.createGraphics(Unknown Source)
at java.awt.image.BufferedImage.getGraphics(Unknown Source)
at com.aspose.cells.b.a.b.i.a(Unknown Source)
at com.aspose.cells.xY.a(Unknown Source)
at com.aspose.cells.WorksheetCollection.W(Unknown Source)
at com.aspose.cells.WorksheetCollection.<init>(Unknown Source)
at com.aspose.cells.Workbook.<init>(Unknown Source)</pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><br></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><br></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><br></pre><pre style="word-wrap: break-word; white-space: pre-wrap;">How can I fix this issue?</pre><pre style="word-wrap: break-word; white-space: pre-wrap;">Thanks,

Mariusz Pala

Hi,

Thanks for your posting and using Aspose.Cells for Java.

The version mentioned by you does not exist as we have latest version is lesser than the one you mentioned.

Please download and try the latest versionAspose.Cells for Java (Latest Version) and see if it resolves your issue.

Ah yes, we’re using v7.3.4, I will try with v7.5.1.2


Thanks,
Mariusz

Hi,

Please try following JVM option when you run the application:

-Djava.awt.headless=true

Hi,


new version solves the issue. Thanks!
BTW, with the previous build adding the mentioned option “-Djava.awt.headless=true” also solved the issue.

Thank you,
Mariusz Pala

Hi,

Thanks for your feedback and using Aspose.Cells for Java.

It is good to know that your issue is resolved now. If you encounter any other issue, please feel free to post on our forums, we will be glad to help you further.