xhost unable to open display,Please set the DISPLAY

Workaround:

1) log into console as root and open a terminal. 
2) DISPLAY=:0.0
3) export DISPLAY
4) xhost +
5) su – oracle
6) DISPLAY=:0.0
7) export DISPLAY

Detail Error:

SPLAY is not set.  Please set the DISPLAY environment variable and try again.
Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:
– For csh:  %% setenv DISPLAY 192.168.1.128:0.0
– For sh, ksh and bash: $ DISPLAY=192.168.1.128:0.0; export DISPLAY
Use the following command to see what shell is being used:
echo $SHELL
Use the following command to view the current DISPLAY environment variable setting:
echo $DISPLAY
– Make sure that client users are authorized to connect to the X Server.
To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:
%% xhost +
To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as ‘xclock’:
%% <full path to xclock; see below>
If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
Typical path for xclock: /usr/X11R6/bin/xclock
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
at java.awt.Window.<init>(Window.java:536)
at java.awt.Frame.<init>(Frame.java:420)
at java.awt.Frame.<init>(Frame.java:385)
at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1758)
at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1833)
at javax.swing.JDialog.<init>(JDialog.java:272)
at javax.swing.JDialog.<init>(JDialog.java:206)
at javax.swing.JDialog.<init>(JDialog.java:154)
at oracle.as.install.engine.modules.presentation.ui.common.dialogs.SpecifyInventoryDirectoryDialog.<init>(SpecifyInventoryDirectoryDialog.java:248)
at oracle.as.install.engine.modules.presentation.ui.common.dialogs.SpecifyInventoryDirectoryDialog.showDialog(SpecifyInventoryDirectoryDialog.java:781)
at oracle.sysman.oio.oioc.OiocOneClickInstaller.main(OiocOneClickInstaller.java:643)

The log(s) can be found here: /tmp/OraInstall2018-07-12_12-27-39AM.


Posted

in

by

Tags: