CentOS8安装pycharm报错【Can't connect to X11 window server using ':0' as the value of the DISPLAY variable. 】

  在CentOS8 安装pycharm报出如下错误,原来是自己画蛇添足的用sudo执行pycharm.sh,没有按照Install说明里边的直接执行 ./pycharm.sh。

原因见这里:https://www.cnblogs.com/qingqing74647464/p/8685837.html

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
No protocol specified
2020-03-30 03:39:39,467 [    621]   WARN -        #com.intellij.idea.Main - java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable. 
java.util.concurrent.ExecutionException: java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
    at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
    at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
    at com.intellij.idea.StartupUtil.runInEdtAndWait(StartupUtil.java:678)
    at com.intellij.idea.StartupUtil.lambda$showUserAgreementAndConsentsIfNeeded$15(StartupUtil.java:673)
    at com.intellij.ui.AppUIUtil.showConsentsAgreementIfNeeded(AppUIUtil.java:332)
    at com.intellij.idea.StartupUtil.showUserAgreementAndConsentsIfNeeded(StartupUtil.java:673)
    at com.intellij.idea.StartupUtil.startApp(StartupUtil.java:231)
    at com.intellij.idea.StartupUtil.prepareApp(StartupUtil.java:213)
    at com.intellij.ide.plugins.MainRunner.lambda$start$0(MainRunner.java:45)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
    at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
    at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
    at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
    at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:232)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:588)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:583)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:582)
    at java.desktop/java.awt.Toolkit.getEventQueue(Toolkit.java:1499)
    at java.desktop/java.awt.EventQueue.invokeLater(EventQueue.java:1318)
    at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$9(StartupUtil.java:265)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    ... 1 more

 

posted on 2020-03-30 03:54  smoggy  阅读(1511)  评论(0编辑  收藏  举报