Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6723679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:35:51+00:00 2026-05-26T09:35:51+00:00

This question is generic, but is also related to Amazon Web Services. I am

  • 0

This question is generic, but is also related to Amazon Web Services.

I am trying to deploy a Java application to an Amazon cloud server, but the application fails to start because it uses AWT fonts (see the following lines):

TextImage testImage = new TextImageImpl(128, 32, new Margin(0, 8));

// Declare or read the fonts you need
Font header = new Font("Sans-Serif", Font.BOLD, 24);

// 1. specify font and write text with a newline
testImage.useFont(header).writeLine(text).newLine();

The issue I am having is that Amazon’s virtual servers don’t have proper fonts installed and as a result you cannot do image/chart related stuff in your application. See this for more information.
Their customer support suggested using a custom VM image (with either fonts or Oracle JDK installed since Oracle JDK comes with a set of fonts) which is not a clean solution for me.

My question is:
How can I rewrite my code, or package it in a different way, so that it runs on a fresh installation of Open JDK with no additional fonts needed (if at all possible).

By the way, here is a part of the error I’m getting:

Oct 9, 2011 11:05:18 AM org.apache.catalina.core.StandardWrapperValve
invoke SEVERE: Servlet.service() for servlet ZipGrocery Application
threw exception java.lang.Error: Probable fatal error:No fonts found.
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1088)
at sun.font.FontManager.initialiseDeferredFont(FontManager.java:967)
at
sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:254)
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:334) at
sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:77) at
sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:93) at
sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:358)
at sun.font.FontDesignMetrics.(FontDesignMetrics.java:349) at
sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:301) at
sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:787) at
nl.jamiecraane.imagegenerator.impl.TextImageImpl.getFontMetrics(TextImageImpl.java:219)
at
nl.jamiecraane.imagegenerator.impl.TextImageImpl.writeLine(TextImageImpl.java:212)

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:35:52+00:00Added an answer on May 26, 2026 at 9:35 am

    If you had an actual font you had proper licensing to distribute, you could package, load, and register the font as part of your distributed application.

    Font font = Font.createFont(Font.TRUETYPE_FONT, new File("A.ttf"));
    return font.deriveFont(24f);
    

    I’ve found OpenJDK to be buggy and unreliable for production environments. I’d just go with Oracle’s JDK if you can.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a very generic 'best practice' question, but here's an example. Let's say
This is more of an generic XML Schema question, but if and how do
I think this is likely to be a generic .NET assembly loading question, but
I have looked around but cannot find anything that answered this particular question related
This is probably a very generic question but I will shoot anyway since I
I'm aware of this question, and it's follow-up, and also this one, but I
My question is somewhat related to this one: How does a generic constraint prevent
I'm sorry for the generic title of this question but I wish I was
This is a question about generic c++ event driven applications design. Lets assume that
Inspired by this question and answer , how do I create a generic permutations

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.