Java GUI deployment on Unix / Linux

D

Delali Dzirasa

I am just about finished with my first java application, and am in the
process of testing the deployment on a windows box as well as a UNIX box. I
have research / have created an executable jar file and attempted to execute
it in a UNIX environment and got the error below..I created the application
in JBuilder 8 personal..do I need to add a specific library to run this GUI?



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.<clinit>(X11GraphicsEnvironment.java:1

34)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:141)

at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi

ronment.java:62)

at java.awt.Window.init(Window.java:231)

at java.awt.Window.<init>(Window.java:275)

at java.awt.Frame.<init>(Frame.java:401)

at java.awt.Frame.<init>(Frame.java:366)

at javax.swing.JFrame.<init>(JFrame.java:154)

at apl.Frame1.<init>(Frame1.java:165)

at apl.EngineeringDump.main(EngineeringDump.java:86)



apl.EngineeringDump

83 //Main method

84 public static void main(String[] args) {

85 // Data data1 = new Data();

86 Frame1 frame = new Frame1();

87

88 try {

89

90 //; FillFrame(frame);

91

92 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

93 }

94 catch(Exception e) {

95 e.printStackTrace();

96 }

97

98

99 EngineeringDump egd = new EngineeringDump();

100

101 // frame.dm = new DataManager();

102 // frame.FlowDataToGUI(data1);

103 // frame.FlowDataToGUI(data1);

104 }

apl.Frame file:

165 public Frame1() {

166

167 enableEvents(AWTEvent.WINDOW_EVENT_MASK);

168 try {

169 jbInit();

170 }

171 catch(Exception e) {

172 e.printStackTrace();

173 }

174 }



Thanks, any assistance is greately appreciated!

Delali
 
S

Sudsy

Delali said:
I am just about finished with my first java application, and am in the
process of testing the deployment on a windows box as well as a UNIX box. I
have research / have created an executable jar file and attempted to execute
it in a UNIX environment and got the error below..I created the application
in JBuilder 8 personal..do I need to add a specific library to run this GUI?



Exception in thread "main" java.lang.InternalError: Can't connect to X11
window

server using ':0.0' as the value of the DISPLAY variable.

It's telling you that it can't connect to the X server. There are a
couple of likely causes:
- you don't have X running (use command xinit or startx from the
command line)
- the X server is running under a different user id; solution here
is to allow connections using xhost +
 
B

Brad BARCLAY

Delali said:
I am just about finished with my first java application, and am in the
process of testing the deployment on a windows box as well as a UNIX box. I
have research / have created an executable jar file and attempted to execute
it in a UNIX environment and got the error below..I created the application
in JBuilder 8 personal..do I need to add a specific library to run this GUI?



Exception in thread "main" java.lang.InternalError: Can't connect to X11
window

server using ':0.0' as the value of the DISPLAY variable.

No, you just have to verify that your DISPLAY environment variable is
set correctly, and that you're indeed running an X11 server on the
system. If you're running the application as a different user or on a
different host, you may need to use the xhost command to ensure that
host/user has permission to write to your display.

If you have to, check with your system administrator. This isn't a
Java issue -- it's an issue with X server accessibility. HTH!

Brad BARCLAY
 
S

Steve Horsley

nos said:
you might also need to set the DISPLAY environment variable

I find it mush easier to ssh to the server and enable X tunneling. That
sets up all the display stuff for you. Like this:

ssh -X [email protected]

Mind you, you still need an X server running on your PC, which is a bit
tricky under windoze.

Steve.
 
N

Nigel Wade

Sudsy said:
It's telling you that it can't connect to the X server. There are a
couple of likely causes:
- you don't have X running (use command xinit or startx from the
command line)
- the X server is running under a different user id; solution here
is to allow connections using xhost +

xhost + is a dangerous solution as it completely disables the limited
security which X provides (unless you are on a single-user system not
connected to any type of network when network security is irrelevent).
It's ok for a quick-and-dirty test to see if it cures the problem, but
security should be enabled again immediately after the test.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top