Cannot run IntelliJ - NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment

﹥>﹥吖頭↗ 提交于 2019-12-11 10:36:43

问题


I am unable to start IntelliJ with my fresh installed OpenSUSE 13.2

Here's the logs:

xybrek@opensuse:~/idea-IC-139.659.2/bin> ./idea.sh 
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:260)
    at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
    at javax.swing.RepaintManager.<clinit>(RepaintManager.java:226)
    at javax.swing.JComponent.repaint(JComponent.java:4798)
    at java.awt.Component.repaint(Component.java:3303)
    at javax.swing.text.JTextComponent.setEditable(JTextComponent.java:1758)
    at javax.swing.text.JTextComponent.<init>(JTextComponent.java:309)
    at javax.swing.JEditorPane.<init>(JEditorPane.java:199)
    at javax.swing.JTextPane.<init>(JTextPane.java:90)
    at com.intellij.idea.Main.showMessage(Main.java:221)
    at com.intellij.idea.Main.showMessage(Main.java:208)
    at com.intellij.idea.Main.main(Main.java:81)
xybrek@opensuse:~/idea-IC-139.659.2/bin> java -version
openjdk version "1.8.0_25"
OpenJDK Runtime Environment (Zulu 8.4.0.1-linux64) (build 1.8.0_25-b17)
OpenJDK 64-Bit Server VM (Zulu 8.4.0.1-linux64) (build 25.25-b02, mixed mode)

What could be the problem here?


回答1:


I was able to reproduce your issue on OpenSUSE machine with not installed fonts. You may want to try to fix that by installing x11 fonts:

zypper install xorg-x11-fonts xorg-x11-fonts-core

Oracle JDK worked because they have proprietary fonts included in the bundle and fontconfig.properties for them.




回答2:


For some reason it seems Zulu JDK do not have this class (I am not sure) however I have fixed this issue by using the Oracle JDK (tar.gz package will do). Unzip it into a folder path then set the IDEA_JDK=/path/to/jdk in ~/.bashrc for Linux.

Now it works fine.




回答3:


I am sorry to hear that Zulu didn't work for you "out of the box". Azul tests Zulu on a variety of linux platforms and the issue that yo have described is not known. I does look though as if the Idea is being launched with a java.awt.headless=true parameter being set. That could creep in via the JAVA_OPTIONS env variable for example.
If you still want to pursue the Zulu as the JRE engine for your Idea runs - we would be happy to assist. We would need to clarify a few system parameters though.



来源:https://stackoverflow.com/questions/29084674/cannot-run-intellij-noclassdeffounderror-could-not-initialize-class-sun-awt-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!