【问题标题】:software report the Missing awt error when start JProfiler启动 JProfiler 时软件报告 Missing awt 错误
【发布时间】:2020-02-12 14:44:31
【问题描述】:

在 ubuntu 14.04 上,使用 openJDK8,当我启动 jprofiler 时,出现如下错误。 折腾了一天,最后还是没能启动。

    java.lang.ExceptionInInitializerError
    at java.awt.Component.<clinit>(Component.java:593)
    at javax.swing.ImageIcon$2.run(ImageIcon.java:130)
    at javax.swing.ImageIcon.<clinit>(ImageIcon.java:100)
    at com.jprofiler.frontend.ab.a(ejt:315)
    at com.jprofiler.frontend.ab.<clinit>(ejt:47)
    at com.jprofiler.frontend.FrontendApplication.E(ejt:1038)
    at com.jprofiler.frontend.IntegrationApplication.main(ejt:8)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
    at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:62)
    Caused by: java.lang.NullPointerException
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
    at java.awt.Toolkit.loadLibraries(Toolkit.java:1633)
    at java.awt.Toolkit.<clinit>(Toolkit.java:1670)
    ... 20 more
    java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
    at javax.swing.ImageIcon.<init>(ImageIcon.java:198)
    at javax.swing.ImageIcon.<init>(ImageIcon.java:217)
    at com.ejt.framework.gui.eo.<init>(ejt:37)
    at com.ejt.framework.gui.eo.a(ejt:17)
    at com.jprofiler.frontend.ab.a(ejt:315)
    at com.jprofiler.frontend.ab.<clinit>(ejt:47)
    at com.jprofiler.frontend.FrontendApplication.E(ejt:1038)
    at com.jprofiler.frontend.IntegrationApplication.main(ejt:8)

    at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:62)

【问题讨论】:

    标签: java crash jprofiler


    【解决方案1】:

    这是 Java 8u242 的一个新问题。它将很快在 JProfiler 11.1.1 中修复。临时解决方法是使用不同的 JRE 运行 JProfiler。


    由于有些兴趣,我将解释错误是什么:

    此错误的原因是 JProfiler 将私有字段 ClassLoader.sys_paths 设置为 null 以强制重新评估 java.library.path 系统属性。这是向库包添加目录以便加载依赖的本机库的常见技巧。由于a commit作为8u242的一部分发布,新的私有方法ClassLoader.initLibraryPaths()必须在将该字段设置为null后调用,否则无法加载本机库。

    【讨论】:

    • @Ingo Kegel,您能详细说明问题的原因吗?我在 Travis 上运行测试时也遇到了同样的问题,我很想解决这个问题。
    • 谢谢您,这对您很有帮助!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多