gpt4 book ai didi

java - IBM JVM 1.6 SR14 : java. lang.UnsatisfiedLinkError : fontmanager (Not found in com. ibm.oti.vm.bootstrap.library.path)

转载 作者:行者123 更新时间:2023-12-01 14:02:40 28 4
gpt4 key购买 nike

我们将 AIX 计算机上的 IBM Java 从 Java 1.6 SR 9 升级到 Java 1.6 SR14,现在在启动应用程序期间出现以下错误:

Exception in thread "main" java.lang.UnsatisfiedLinkError: fontmanager (Not found in com.ibm.oti.vm.bootstrap.library.path)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1030)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:994)
at java.lang.System.loadLibrary(System.java:507)
at sun.font.FontManager$1.run(FontManager.java:240)
at java.security.AccessController.doPrivileged(AccessController.java:273)
at sun.font.FontManager.<clinit>(FontManager.java:235)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at sun.swing.SwingUtilities2.isComplexLayout(SwingUtilities2.java:203)
at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:736)
at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:704)
at javax.swing.text.rtf.RTFReader$DocumentDestination.deliverText(RTFReader.java:1610)
at javax.swing.text.rtf.RTFReader$TextHandlingDestination.handleText(RTFReader.java:1546)
at javax.swing.text.rtf.RTFReader.handleText(RTFReader.java:186)
at javax.swing.text.rtf.RTFParser.write(RTFParser.java:163)
at javax.swing.text.rtf.AbstractFilter.readFromReader(AbstractFilter.java:116)
at javax.swing.text.rtf.RTFEditorKit.read(RTFEditorKit.java:122)
at Rtf.convert(Rtf.java:17)
at Rtf.main(Rtf.java:29)

以下代码可以重现此问题:

import java.io.StringReader;

import javax.swing.text.DefaultStyledDocument;
import javax.swing.text.Document;
import javax.swing.text.rtf.RTFEditorKit;

public class Rtf {

public Rtf() {
}

static public String convert(String rtf) throws Exception {
DefaultStyledDocument styledDoc = new DefaultStyledDocument();
RTFEditorKit rtfKit = new RTFEditorKit();
StringReader reader = null;
reader = new StringReader(rtf);
rtfKit.read(reader, styledDoc, 0);
Document doc = styledDoc.getDefaultRootElement().getDocument();
String txt = doc.getText(0, doc.getLength());
return txt;
}

public static void main(String[] args) throws Exception {
System.getProperties().store(System.out, "Current System props");

System.out.println("fontmanger LIB: "+ System.mapLibraryName("fontmanager"));

String rtf="{\\rtf1\\deff0{\\fonttbl{\\f0 Times New Roman;}{\\f1 Courier New;}}{\\colortbl\\red0\\green0\\blue0 ;\\red0\\green0\\blue255 ;}{\\*\\listoverridetable}{\\stylesheet {\\ql\\f1\\fs2
0\\cf0 Normal;}{\\*\\cs1\\f1\\fs20\\cf0 Default Paragraph Font;}{\\*\\cs2\\sbasedon1\\f1\\fs20\\cf0 Line Number;}{\\*\\cs3\\ul\\f1\\fs20\\cf1 Hyperlink;}}\\sectd\\pard\\plain\\ql{\\f1\\fs20\\cf0 draw 2 extra
6ml lav. label with chart labels\"}\\f1\\fs20\\par\\pard\\plain\\ql{\\f1\\fs20\\cf0 ?When to Transfuse: When Avl}\\f1\\fs20\\par}";
String txt = Rtf.convert(rtf);
}
}

如果在没有任何 jvm 参数的情况下运行 Rtf 类,则没有任何异常(exception):

java Rtf

但是如果使用 "-Dcom.sun.management.jmxremote" jvm 参数运行 Rtf 类,则会出现异常 "Thread "main"java.lang.UnsatisfiedLinkError: 异常: fontmanager(在 com.ibm.oti.vm.bootstrap.library.path 中找不到)”:

java -Djava.awt.headless=true -Dcom.sun.management.jmxremote Rtf  

有人知道如何解决这个问题吗?

最佳答案

解决方法是将目录/usr/java6_64/jre/lib/ppc64/xawt 添加到当前 LIBPATH。

关于java - IBM JVM 1.6 SR14 : java. lang.UnsatisfiedLinkError : fontmanager (Not found in com. ibm.oti.vm.bootstrap.library.path),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19224511/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com