-
Trouble with jdk?
Ok, I'm using Knoppix 5.1 and everytime I try to compile a source with jdk that has import javax.swing.JOptionPane; I get an error like this:
Code:
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java:53)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:142)
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:164)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:96)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at java.awt.Toolkit$2.run(Toolkit.java:821)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)
at javax.swing.UIManager.initialize(UIManager.java:1262)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1245)
at javax.swing.UIManager.getUI(UIManager.java:851)
at javax.swing.JOptionPane.updateUI(JOptionPane.java:1810)
at javax.swing.JOptionPane.<init>(JOptionPane.java:1773)
at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:831)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:645)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:616)
at Welcome.main(Welcome.java:5)
root@Me:/home/Israel/Java#
Any suggestions?
-
Senior Member
registered user
You appear to be attempting this while being logged as root. Do it instead under your regular account, from a konsole or xterm under X-xindows. Or at least issue "xhost +" to allow other accounts to access the display (eg root but anyone from any host, really, which is not advisable).
-
Ah... It ran with X-terminal! Thank you!
Similar Threads
-
By AJones in forum General Support
Replies: 1
Last Post: 01-05-2007, 07:26 PM
-
By nirav1983 in forum Hardware & Booting
Replies: 9
Last Post: 10-12-2004, 06:05 PM
-
By Zidave in forum General Support
Replies: 1
Last Post: 02-20-2004, 03:22 PM
-
By Enigma13 in forum General Support
Replies: 1
Last Post: 12-02-2003, 11:14 AM
-
By Seeker in forum General Support
Replies: 1
Last Post: 09-26-2003, 09:53 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

LENOVO THINKPAD T14s GEN 2a Ryzen 7 PRO 5850U 1.9GHz 16GB 256GB TOUCH - NO OS
$299.95

Lenovo Thinkpad T14 Gen 2 14" 16GB, Thunder Black
$313.00

Lenovo ThinkPad L14 Gen 3 Laptop 14” FHD Core i5 12th 16GB RAM 512GB SSD Win 11
$374.99

Lenovo Thinkpad E15 Gen 2 8GB RAM 256GB SSD Intel Core [email protected] Laptop
$220.36

Lenovo Thinkpad T14 Gen 2i 14" 16GB 512GB, Black
$313.00

Lenovo ThinkPad L14 Gen 1 i5-10210U 16GB 512GB SSD Win 11 Pro Very Good
$229.99

Lenovo Legion 5 Gaming 15.1" WQXGA OLED 165Hz Core i9-14900HX 16GB 1TB RTX 5070
$1439.00

Lenovo T14 G1 i7-10610U 16GB RAM/500 GB SSD - Win 10 Pro TOUCHSCREEN Small Chip
$230.00

Lenovo Thinkpad E15 15.6" Laptop i5/i3 8GB RAM Up to 1TB SSD HDD Tested Working
$136.55

Lenovo ThinkPad L15 Gen 3 15.6" 16GB, Thunder Black
$242.00