简体   繁体   中英

Upgrading to JRE7 throws java.lang.NoClassDefFoundError

My product was running with JRE 6.31 without any problems. Now I am trying to set it to work with JRE 7, but when I run it on a Linux machine I am getting:

java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager

When calling to java.awt.Font.canDisplayUpTo() . Is this case looks familiar to someone?

Seems that your Linux machine either does not have X11 installed, or has not a X display available.

If yours is a server application, try to force the headless rendering by using the command line switch:

-Djava.awt.headless=true 

EDIT:

Also, users reported that on Linux systems, both Oracle JDK 1.7 and OpenJDK 1.7 require the dejavu font installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM