LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-17-2004, 08:41 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
java can't display


hi need to run the following commands to debug a program
1 # Compile the java installation program
2 javac -classpath java java/Install/Install.java
3 # Execute the compiled java program
4 java -classpath java Install.Install -compile

but when i am executing i take the following message



akroneiro:/usr/local/JabberwockyBinary # ./install
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as th
e value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:134)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
at java.awt.Font.initializeFont(Font.java:308)
at java.awt.Font.<init>(Font.java:344)
at javax.swing.plaf.metal.DefaultMetalTheme$FontDelegate.getFont(DefaultMetalTheme.java:195)
at javax.swing.plaf.metal.DefaultMetalTheme.getFont(DefaultMetalTheme.java:153)
at javax.swing.plaf.metal.DefaultMetalTheme.getControlTextFont(DefaultMetalTheme.java:129)
at javax.swing.plaf.metal.MetalLookAndFeel$FontActiveValue.createValue(MetalLookAndFeel.java:1399
)
at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:196)
at javax.swing.UIDefaults.get(UIDefaults.java:126)
at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
at javax.swing.UIDefaults.getFont(UIDefaults.java:346)
at javax.swing.UIManager.getFont(UIManager.java:491)
at javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:89)
at javax.swing.plaf.basic.BasicLabelUI.installDefaults(BasicLabelUI.java:302)
at javax.swing.plaf.basic.BasicLabelUI.installUI(BasicLabelUI.java:254)
at javax.swing.JComponent.setUI(JComponent.java:449)
at javax.swing.JLabel.setUI(JLabel.java:238)
at javax.swing.JLabel.updateUI(JLabel.java:248)
at javax.swing.JLabel.<init>(JLabel.java:141)
at javax.swing.JLabel.<init>(JLabel.java:171)
at Install.Install.main(Install.java:71)





as you can see it can't connect as 0:0
the display has value
akroneiro:/usr/local/JabberwockyBinary # echo $DISPLAY
:0.0

What i must do?
 
Old 04-17-2004, 11:51 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,795

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
can you run a regular X11 program, say xclock from the same shell ?
 
Old 04-17-2004, 12:30 PM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
yep

unfortunately yes......
 
Old 04-17-2004, 03:51 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,795

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
try "xhost +"
 
Old 04-18-2004, 01:25 AM   #5
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
thx but

i have tried it..... I was thinkinf is the way i used the command wasn't the right..
 
Old 04-18-2004, 07:33 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,795

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
Well, the commands you show look correct.
The problem probably lies either on your X11 server or in the native graphic library your java implementation is using.
But you do not tell us what they are.
Did you have the chance to try your program on a different platform ?
Have your tried using "<hostname>:0" or localhost:0 ?
 
Old 04-18-2004, 08:36 AM   #7
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
nop

Can u explain me more what do u mean....what i must write in the console?
 
Old 04-18-2004, 06:57 PM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,795

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
export DISPLAY=$(hostname):0

export DISPLAY=127.0.0.1:0
 
Old 04-19-2004, 05:04 AM   #9
nazula
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Rep: Reputation: 0
Are you allready test this?
Code:
java -Djava.awt.headless=true
 
Old 08-29-2004, 09:43 AM   #10
rodito79
LQ Newbie
 
Registered: Aug 2004
Distribution: Red Hat 9
Posts: 1

Rep: Reputation: 0
Same problem no results

Hi folks,

I have tried all that you talk and I'm having the same problem!!! my application is using ssh and is maded with AWT.

Please any help that you can bring to me??

Greetings,
 
Old 08-29-2004, 10:11 AM   #11
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,795

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
What is doing the "install" command ?

How is ssh related to that ?
Are you remotely connected to some host through ssh ?
Is you application itself using ssh ?
 
  


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
Java/X11 Display Property Error jonnybot Slackware 7 06-11-2009 10:47 AM
java - howto display an image and find mouse coords on it? titanium_geek Programming 6 06-04-2005 11:41 AM
Any way to redirect DISPLAY inside Java app? paulsm4 Programming 0 03-23-2005 07:35 PM
mozilla & netscape browsers are not able to display java applets ks_krishna76 Linux - Software 5 03-29-2004 11:28 PM
KDE W/ java doesn't display popup applet correctly gdsylvester Linux - Software 2 01-06-2004 11:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:21 PM.

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