"Cannot open display" error when trying to install JBoss on Linux - linux

I am unable to install JBoss on a Linux VM virtual box.
I'm getting this error:
$ java -jar jboss-eap-6.2.0-installer.jar
(.:1616): Gtk-WARNING **: cannot open display:
How can I fix this?

The EAP installer has a graphical interface. It looks as if your Linux VM either doesn't have an X desktop, or you are logging into it using something other than an X session. To use the graphical installer you will need to run it from a shell within an X desktop (in which case you might just need to set do export DISPLAY=:0.0 or something similar); or you'll need to take some other convoluted steps to get X running and be able to run executables against the X server.
If you can't run an X desktop, or don't want to, I believe EAP is available as a zipfile you can just unpack.

You have to provide a value for the DISPLAY variable, e.g. in my case
Microknoppix:~$ echo $DISPLAY
:0

Related

Why can't I install WebStorm on Linux Fedora 27?

I want to install WebStorm on Fedora 27. I start ./webstorm.sh but it doesn't work.
How can I solve this problem?
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.
Java.AWT library requires X11 GUI environment to work. Do you work on your Linux workstation directly, or access it remotely? Also, what JDK do you run WebStorm with? make sure that it has the graphical libraries included.
See also this link for more info
try this first:
$ chmod +x ./webstorm.sh
and then
$ ./webstorm.sh

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 ?
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.
Your X environment is not properly set (manually setting DISPLAY doesn't always work). Possibly because you're attempting this as root and root is not the owner of the graphics session. There could be other reasons, too.
You won't be able to run xclock or any other X app either in this situation - this is the clue that it's not a pycharm-related problem. For example if you ssh to localhost as root, not as the user currently logged in into the graphical session:
laptop:~ # ssh localhost
Password:
Last login: Thu Nov 23 22:19:06 2017 from localhost
Have a lot of fun...
laptop:~ # export DISPLAY=:0
laptop:~ # xclock
No protocol specified
Error: Can't open display: :0
laptop:~ # konsole
No protocol specified
Segmentation fault
laptop:~ # pycharm
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
No protocol specified
Start Failed: Failed to initialize graphics environment
You'd also see the same behaviour if you attempt the same in a text-mode console.
To address this issue open a new terminal from the graphics environment - if it is properly installed you should be able to run any of the X apps, including pycharm (or at least it shouldn't fail with that error).
In fedora
I have installed pycharm using fedy. This is worked.
Or change to a another user and try except root.
Phpstrom, Webstrom, PyCharm
Above three of them worked same like that.
In my case I am runing pycharm through docker, which is different host, run command xhost + , this would disable access control and client would be able to connect from any host.
Try running the program from another user instead of root. It worked for me.
I used OpenJDK instead of Oracle Java, because PyCharm hangs on Raspberry Pi.
In the file /etc/java-8-openjdk/accessibility.properties, disabling the entry assistive_technologies (simply comment out with a #) solved the issue.
This is what resolved my issue:
export DISPLAY='localhost:11'

(Linux) How to run a program of gtk without display environment? Gtk-WARNING **: cannot open display:

I got a program which must run in GTK gui environment.
I can only use ssh.
This program will run on a server(centos 6) and installed gnome X display.
It's no need to see GUI, but after it run finished, i can get the answer.
VNC and Remote screen is disable.
When i start the program in ssh:
Gtk-WARNING **: cannot open display:
Is there any ways to salve this problem???
I known it's bad to run a gui program in this situation, but here we only discuss technology...
Thank you...
The ssh utility has an option -X which enables X11 forwarding.
Have you tried to connect to your destination like that ?
Or the other option is to perform the export DISPLAY=:0.0 after you log-in to your host, then run your app.
This way you'll save some network traffic, will run your app remotely, but the GUI will be displayed on the screen of the remote host.
P.S. Generally speaking your application logic might be invalid if it fails to run GUI.
Are you sure that your application will do the expected stuff when it fails to run the GUI ?

Linux - Avoinding x server message when running .exe with wine

I'm trying to run a .exe file (that uses some other .dll files) with wine, in Ubuntu 11.04, command line, but i get an error regarding the x server not being started and that a window is being created (i attached a screenshot).
When I run it normally (normal ubuntu boot, x server running) everything is ok, but actually, no window is displayed, which is normal because no window is needed for the program to run. So I just want to know if there is a way to avoid that: somehow simulating that the x server is open or to set $DISPLAY in some way to "fool" the program.
Just use Xvfb.
Xvfb :1 &
DISPLAY=:1 wine ...

Bootable Qt-Linux Application

How to boot a linux kernel + dependencies and auto run a Qt application so the linux environment doesn't show up (only the Qt GUI is visible)?
on x86 PCs
should be able to run from RAM (of course)
Perhaps you could look at how this guy did it:
http://www.embedded-bits.co.uk/2011/1-second-linux-boot-to-qt/
You could start with a minimal linux distribution such as Ubuntu Server and install only X-Windows (without any Window Manager) on top of it: https://help.ubuntu.com/community/ServerGUI
Then, start your Qt application by adding a call to it in the .xinitrc initialization script.
Might be helpfull Linux Journal KDE Kiosk Mode
Why not run x server without window manager and the running the application in full screen mode on that x server.
to start x server type startx
and then you must run your application in fullscreen mode
(your app must support this mode by argument switch like this)
./myapp --fullscreen
I have never tried this, but try google for 'framebuffer'. It should allow you to run a single application with no need for X server.

Resources