Fontconfig error: No writable cache directories during conversion of DWG to DXF file in Linux environment

Support team,

I am trying to convert DWG file to DXF using java code. My java code is working fine in WINDOWS but it is failing in Linux environment with below error
“Fontconfig error: No writable cache directories”

Here is the java code snippet.

ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Image image = Image.load(multpartFile.getInputStream());
DxfOptions options = new DxfOptions();
CadRasterizationOptions cadRasterizationOptions=new CadRasterizationOptions();
cadRasterizationOptions.setDrawType(CadDrawTypeMode.UseObjectColor);
options.setVectorRasterizationOptions(cadRasterizationOptions);
options.setOutputMode(CadOutputMode.Convert);
image.save(outputStream,options);

Please provide the inputs to proceed further.

@shivanandtripathi

Can you please provide more details about the environment setup in Linux, such as the version of Fontconfig and any specific configurations you have made?

Here is the required details of the environment.
Amazon Linux 2023.6.20250218
fontconfig version 2.13.94

Please suggest if code changes or configuration changes has to be made to resolve the issue.