Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

linux - Pycharm Startup Error: Unable to detect graphics environment

I'm trying to setup Pycharm professional edition on Fedora 25 x64. After downloading the files and extracting them, I'm trying to run the script ./pycharm.sh in the bin directory. This is the error I get:

Startup Error: Unable to detect graphics environment

I have checked my Java version

[root@localhost bin]# java -version
openjdk version "1.8.0_144"
OpenJDK Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)

I tried as well to set the DISPLAY variable:

export DISPLAY=:0 

And this is what I get:

[root@localhost bin]# ./pycharm.sh 
No protocol specified

Start Failed: Failed to initialize graphics environment

java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.

Any suggestions please ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had the same error installing in a clean Ubuntu 17.10, with Gnome on Wayland. At @mattdm's suggestion in your comments, I just opened a new terminal (as myself, not root) and it ran fine. I was running as root (after unpacking everything to /opt/) when I got the error.

mike@feynman:~$ /opt/pycharm/bin/pycharm.sh

Once you register/activate, just click the "* Configure v" pulldown from the welcome window, and select "Create Desktop Entry" to make it available from your OS menus. I'm assuming JetBrains made this work for whichever linux flavor you prefer.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...