Tomcat7 missing fonts

I recently migrated my tomcat7 server to a new esxi server and had the following issue:

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

There are a few explanations found on the web:

  1. Tomcat is running headless. Add this -Djava.awt.headless to /etc/init.d/tomcat7. Checked, was there already so this is not the cause.
  2. Add missing fonts: apt-get install msttcorefonts This also didn't fix the problem
  3. Used Sun Java. Hmmm, indeed I just installed tomcat and let the dependencies automatically install. Should have used the sun java.
  4. One more fix: apt-get install ttf-dejavu

Ok, installing the ttf-dejavu fixed the issue!

Next time I will make sure not to use the open-jdk but the sun-jdk to prevent this issue.

Leave a comment

Your email address will not be published. Required fields are marked *