Hi,
I’m facing IncompatibleClassChangeError while calling workbook.save(): 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 java.io.*;
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
workbook.save(myDir + "MyPdfFile.pdf", SaveFormat.PDF);
}
}