java.lang.ClassNotFoundException: Didn't find class "java.awt.SystemColor"

sourceCompatibility JavaVersion.VERSION_1_8
minSdk 24
targetSdk 33

Workbook workbook = new Workbook(fileName);

@constgroup,

Could you please zip and attach your input Excel file, we will check your issue soon.

example.zip (6,8 КБ)

Hello. I have the same problem now in the same Java version. I tried to read many versions of my Excel file but have the same exception with all of it. I add to message my input Excel file. Please, help…
example.zip (6.83 KB)

@gelkina,

Thanks for providing us template Excel file.

I tested your scenario/case using the latest Aspose.Cells for Java v25.4 and it works fine. I used the following line of code with your Excel file which did not give me any exception or error.

Workbook workbook = new Workbook("d:\\files\\templt_appendix2.xlsx");

Are you using Aspose.Cells for Java or Aspose.Cells for Android via Java? For your issue, could you please try to access java.awt.SystemColor directly without referencing/using to Aspose.Cells for Java to see whether this class can work for your environment or not?

System.out.println(java.awt.SystemColor.scrollbar);
System.out.println(java.awt.SystemColor.desktop);

Moreover, we think you should set your JVM option to headless mode if it works on your end? Please try to set the JVM options “java.awt.headless=true” or “Aspose.Cells.Disable=SunFontManager” when starting your application, it should solve your problem.
You can set “java.awt.headless=true” through code before starting or executing application code, as shown below.

System.setProperty("java.awt.headless", "true");
//.......
// your code goes here.
//.......

In case you still find the issue, kindly give us complete stack trace/error description. Which Aspose.Cells for Java or Aspose.Cells for Android via Java version you are using? Moreover, give us your complete environment details. We will look into it soon.