This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

"fonts not found"

bill steve

Joined: Feb 22, 2011
Posts: 7

everyday a new problem.

i have a simple program (below). Works fine on my laptop. when i run the same thing on a unix server, i get an error, telling me that FontManager can't find the fonts. it sounds like a problem with the java installation on unix. i can see font files in the /lib/fonts directory. doesn't make sense to me.

any suggestions on what the problem might be?

java.lang.Error: Probable fatal error:No fonts found.
:at sun.font.FontManager.getDefaultPhysicalFont(
:at sun.font.FontManager.initialiseDeferredFont(
:at sun.font.FontManager.initialiseDeferredFonts(


import java.awt.Font;
import java.awt.GraphicsEnvironment;
public class FontFamilyNameList {
public static void main(String[] args) {
// Get all available font family names from GraphicsEnvironment
System.setProperty("java.awt.headless", "true");
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
String familyNames[] = ge.getAvailableFontFamilyNames();
for (String familyName : familyNames) {
System.out.println("Family names: " + familyName);

Death Arte

Joined: Feb 17, 2011
Posts: 21

try to read this discussion.

Probable fatal error: No fonts found
Rob Spoor

Joined: Oct 27, 2005
Posts: 19651

Once is enough, Bill. UseOneThreadPerQuestion. Because your other thread has more information in the starting post I'll close this one but link to it in the other one because of Myk's post.

How To Ask Questions How To Answer Questions
It is sorta covered in the JavaRanch Style Guide.
subject: "fonts not found"
Similar Threads
New Fonts in Java Runtime
Complex type, using axis
How to deal with the GraphicsEnvironment abstract class ?
Complex type, using axis