Found interface sun.font.FontManager- but class was expected


I’m facing IncompatibleClassChangeError while calling Found interface sun.font.FontManager, but class was expected.

error after setting System.setProperty(“java.awt.headless”, “true”); also the same error persists

can you pl help me to get rid of this error .

here is my code
package com.dhar.exmps;

import com.aspose.cells.;
//Note: Import the following package/classes from the Aspose.Pdf for Java library.
import aspose.pdf.
public class Oposeexceltopdf {

 * @param args
 * @throws Exception 
public static void main(String[] args) throws Exception {

	System.setProperty("java.awt.headless", "true");
	String myDir = "C:\\Balaji\\doclocation\\";
	//Instantiate a new workbook with Excel file path
	Workbook workbook = new Workbook(myDir + "sample.xls");

	//Save the document in PDF format + "MyPdfFile.pdf", SaveFormat.PDF);


Hi Murli,

Thank you for contacting Aspose support.

We will require your environment details to further investigate the problem cause on our end. We are interested in the following details,

  • Operating System version
  • Operating System Architecture (32bit/64bit)
  • Java type & version
  • Aspose.Cells for Java version

Before your provide us these details, please give a try to the latest version of Aspose.Cells for Java 8.0.2 on your end to see if it makes any difference. Please note, you have to add reference of following Jar files in your project.

  • aspose-cells-8.0.2.jar
  • bcprov-jdk16-146.jar