我正在尝试使用Dynamic Code Evolution VM集成插件在IntelliJ中使用DCEVM运行Swing客户端。当我启动应用程序时,它崩溃并出现以下异常
Exception in thread "main" java.lang.UnsatisfiedLinkError: no freetype in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:59)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerNativeLibrary.<clinit>(FontManagerNativeLibrary.java:32)
And
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class sun.font.SunFontManager
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264)
at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1012)
at javax.swing.JComponent.getFontMetrics(JComponent.java:1624)
at javax.swing.plaf.synth.SynthGraphicsUtils.getPreferredSize(SynthGraphicsUtils.java:283)
at javax.swing.plaf.synth.SynthGraphicsUtils.getMinimumSize(SynthGraphicsUtils.java:195)
at javax.swing.plaf.synth.SynthButtonUI.getMinimumSize(SynthButtonUI.java:461)
我确认SunFontManager存在于rt.jar中。有什么想法吗?
答案 0 :(得分:1)
DCEVM不附带字体。因此,当JVM尝试加载字体时,它不会发现任何和崩溃。幸运的是,修复非常简单。只需从另一个JDK / JRE复制字体即可。你会在/ jre / lib / fonts找到它们。将整个目录复制到/ lib。