We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

[RESOLVED] Found interface sun.font.FontManager- but class was expected

Hi,

just decided to give Aspose.Cells a try, but I’m facing IncompatibleClassChangeError while calling workbook.save(): Found interface sun.font.FontManager, but class was expected.

I believe it is due to difference between Java 1.6 and 1.7, but wonder how to solve it.

I’m (obviously) using 1.7.

Thank you!

Hi,

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

Please set the following property true to get rid of this error.

System.setProperty(“java.awt.headless”, “true”);

We think, if you will install microsoft fonts on your Linux machine, your issue will be resolved. Please try it and let us know your feedback.

We have looked into this issue and tested it on Linux Ubuntu 12.04.1 LTS.

Please install Microsoft TrueType Core Fonts. I have attached the core fonts screenshot for your help.

Please use the following code to generate a pdf from your source file for your reference.

Java


System.setProperty(“java.awt.headless”, “true”);


String filePath = “/media/OrderTest.xls”;


// CellsHelper.setFontDir("/usr/share/fonts");


Workbook workbook = new Workbook(filePath);


workbook.save(filePath + “.out.pdf”);

Microsoft TrueType Core Fonts:

Settings java.awt.headless to true helped, thank you.

Hi,

Thanks for your feedback.

We are glad to know that setting the property to true has resolved your issue.

If you face any other issue, please feel free to post on our forums, we will be glad to help you further.

Thank you once again.

I am facing the same issue but unable to fix it on window with this code

System.setProperty(“java.awt.headless”, “true”);

Hi,


Thanks for your posting and using Aspose.Cells.

Please create a separate thread with all the details of your issue. Please provide us your System/OS Runtime Environment, sample code and source excel file(s) if there are any. We will look into your issue and help you asap.

Please download and try the following latest fix: Aspose.Cells for Java v17.1.2 and let us know your feedback. It should fix your issue.

If you still have a problem, please also try

System.setProperty(“Aspose.Cells.Disable”, “SunFontManager”);