有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java软件在启动JProfiler时报告丢失的awt错误

在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)

共 (1) 个答案

  1. # 1 楼答案

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


    既然有人对此感兴趣,我将解释错误是什么:

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