LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2012, 10:21 AM   #1
carlosjohns@gmail.com
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Rep: Reputation: Disabled
Java & Linux


How do i resolve this issue below:

Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using '0:0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:110)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
at sun.swing.SwingUtilities2.isLocalDisplay(SwingUtilities2.java:1457)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1556)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1592)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:536)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:576)
at com.acrosswireless.asap.registry.ConfigManager.main(ConfigManager.java:233)
 
Old 10-09-2012, 10:37 AM   #2
EODSteven
Member
 
Registered: Oct 2012
Location: Manchester, Tn
Distribution: Ubuntu 14.04, Windows 8, Windows Server 2012. Ubuntu Server 14.04
Posts: 196

Rep: Reputation: 3
Just a guess based on the limited information but it looks like a path issue to me.
 
1 members found this post helpful.
Old 10-09-2012, 10:38 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by carlosjohns@gmail.com View Post
How do i resolve this issue below:

Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using '0:0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:110)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
at sun.swing.SwingUtilities2.isLocalDisplay(SwingUtilities2.java:1457)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1556)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1592)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:536)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:576)
at com.acrosswireless.asap.registry.ConfigManager.main(ConfigManager.java:233)
You don't provide any useful details, so it's hard for anyone to help you. How are you connecting to the Linux machine? Does that Linux machine have a GUI/window-manager running on it? Version/distro of Linux? Type of GUI? What you're trying to run? ANYTHING??

Based on the error bolded above, the short answer is the workstation you're using either doesn't have X windows running on it, it does not allow remote incoming X sessions, or you have not exported your display variable. Export it with "export DISPLAY=<IP address of remote workstation>:0", then run the command.
 
1 members found this post helpful.
Old 10-09-2012, 10:50 AM   #4
carlosjohns@gmail.com
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi Guys....

Sorry about that... Thanks for the quick response....

Let me give some info here.

This is a RHEL 6 install...

have an script / app that is used as a configuration manger....

created user... dpa

the Java path set in the user environment:

PATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:/usr/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/java/jdk1.7.0_04/bin:/home/oracle/bin
JAVA_HOME=/usr/java/jdk1.7.0_04

DISPLAY=:0.0

the script is suppose to open an gui....

worked on getting the environment right to allow java path to be seen by the "dpa" user...

Let me know what info you would need and I will post it...

Thanx Guys!

:-)
 
Old 10-09-2012, 10:55 AM   #5
carlosjohns@gmail.com
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am direct connect... to the Linux machine...
 
Old 10-09-2012, 11:40 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by carlosjohns@gmail.com View Post
Sorry about that... Thanks for the quick response....Let me give some info here.
This is a RHEL 6 install...have an script / app that is used as a configuration manger....

created user... dpa
the Java path set in the user environment:
PATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:/usr/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/java/jdk1.7.0_04/bin:/home/oracle/bin
JAVA_HOME=/usr/java/jdk1.7.0_04
DISPLAY=:0.0
the script is suppose to open an gui....worked on getting the environment right to allow java path to be seen by the "dpa" user...
Let me know what info you would need and I will post it...
Again, please see my earlier reply. This has nothing to do with your Java path, but the fact that you don't have a running X server on the workstation you're ON.
Quote:
Originally Posted by carlosjohns@gmail.com View Post
I am direct connect... to the Linux machine...
"Direct connect"? HOW are you connected?? Unless you are sitting at the console and have a GUI running, you are not 'direct connected'. You're going in over the network, from another machine. Which brings us back to what that machine is running, does IT have a running X server/emulator, and does it allow incoming X sessions.

Also, since you're using RHEL6, you do know that (by default), X windows/GUI's are NOT installed, unless you specifically install them, right? And, since RHEL is a commercial pay-for distro...have you contacted Red Hat support for assistance?
 
1 members found this post helpful.
Old 10-09-2012, 01:25 PM   #7
carlosjohns@gmail.com
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi TB0ne,

Thank you so much for answering my question...

I am sitting at console and have GUI running.....

Got it working....

funny thing is when script was written is was written with switches that could be used.... this was not communicated to me....

none the less...

X-windows is installed and working on the machine ..... I did install them, running other GUI apps.... :-)

yes the machine does allow incoming sessions....

this a lab machine, we are simulating a commercial environment

have not contacted RHEL for support....


now this is what I found on the web about this error:

Set JVM default property with _JAVA_OPTIONS

export _JAVA_OPTIONS=-Djava.awt.headless=true

java |more
Picked up _JAVA_OPTIONS: -Djava.awt.headless=true



Setting JVM -Djava.awt.headless=true is necessary if X server is not available.
Without this property following error is thrown:

Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using '' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at sun.font.FontManager.initSGEnv(FontManager.java:1307)
at sun.font.FontManager.findFont2D(FontManager.java:1984)
at java.awt.Font.getFont2D(Font.java:455)
at java.awt.Font.canDisplay(Font.java:1904)
at java.awt.Font.canDisplayUpTo(Font.java:1970)
at java.awt.font.TextLayout.singleFont(TextLayout.java:451)
at java.awt.font.TextLayout.<init>(TextLayout.java:509)
at org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1675)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Java Sound& Music Software for Linux, Part 1 LXer Syndicated Linux News 0 09-08-2008 02:50 PM
Time Differences between linux & windows in my Java App MRMadhav Programming 4 05-09-2006 03:21 AM
java & midi in linux angelo_maci Programming 1 04-29-2006 12:33 PM
how to install java & tomcat server in linux adityakumar Linux - Software 2 06-04-2005 10:51 PM
Java fonts in Linux Firefox & Gnome notify gaim madiyaan Linux - Newbie 0 01-05-2005 12:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration