Free Support Forum -

java.lang.Error: Probable fatal error:No fonts found


we are trying to generate excel from pl/sql.

we generate excel.

we set the -Djava.awt.headless=true

but when we set the worksheet.autofitcolumns();

we get the following exceptions.

Exception in thread “Root Thread” java.lang.Error: Probable fatal error:No fonts found.
at sun.font.FontManager.getFont2D(
at sun.font.FontDesignMetrics.initMatrixAndMetrics(
at sun.font.FontDesignMetrics.(
at sun.font.FontDesignMetrics.(
at oracle.aurora.awt.OracleToolkit.getFontMetrics(
at sun.awt.HeadlessToolkit.getFontMetrics(
at java.awt.Component.getFontMetrics(
at javax.swing.JComponent.getFontMetrics(
at com.aspose.cells.bJ.c(Unknown Source)
at com.aspose.cells.bJ.(Unknown Source)
at Source)
at Source)
at com.aspose.cells.Worksheet.autoFitColumns(Unknown Source)
at autofitcolumn.testExcel(

any suggestions on this will be appreciated.

Thanks & regards.


we dig into google to find solution.

we need to upload fonts to oracle jvm.

which fonts ur using either system fonts or jre fonts.

any suggestions on this.

Thanks & regards



What is your OS and runtime environment? We use standard Java fonts.
Thank you.


we are using linux OS.

we trying to generate excel from oracle jvm.

can you tell me where can i get java fonts?

Thanks & regards

Ranjith kumar.

We use java.awt.Font in general that is used in Java application in the common way. To measure the width/height of cells’ content, we use java.awt.Font and java.awt.FontMetrics as following:
java.awt.Font font = new java.awt.Font(name, style, size);
new JLabel().getFontMetrics(font);
Please try this simple code (with the fonts used in your template file) in your environment without any reference to Aspose.Cells. If it can work, then auto-fit function should work fine too.
Thank you.

Hello Ranjithv

please try the follow way , maybe it can help you to solve the question:

for Redhat Linux , I suggest you to run the follow command


yum install liberation-fonts

for other linux product , maybe you can follow the article: