This content has been marked as final. Show 15 replies
Make Sure that your .class file is in your library
you may check by navigating folders jdk1.X--->lib--->
or else you have to set class path
set class path in your cmd prompt
c:/> set classpath=%classpath%; c:/jdk1.6/lib; for windows
simillarly you may try with shell programming in unix
then compile your class and then execute....
this will work
Edited by: rajesh_beu on Mar 19, 2008 5:18 AM
The host's X server is not accessible from a client thats logged in via a terminal.Usually no X server runs on a "server" host. The X server runs on the "client", it is server in the sense of the GUI environment.
In order to handle the screen(s), the keyboard, the pointing device it should run on the box where they are connected to.
Usually you start the X server on your box, login to the the remote host, set the DISPLAY variable to point to your box, enable the host to connect to your X server, and then run the GUI-aware programs on the remote host.
Thanks for your reply!
Please correct me if my understanding is wrong.
I have a remote machine in which the java application is present. I connect to this remote machine through SSH secure client from my laptop and run java -jar <jar file name>.
From your response, I find that X server should run on the client. So, in this case, the client is the laptop in which the terminal is running?
Also, please let me know how to enable the remote host to connect to the X server.
Thanks in advance!
So, in this case, the client is the laptop in which the terminal is running?If you want to remotely use the screen, the keyboard and the pointing device (aka mouse) of the laptop, then yes.
You'll need an X-Server for the OS of your laptop. What is it? Linux comes with the XFree server, and there are several X-Servers for Windows too, including the free Cygnus one (Red Hat).
You'll need to enable the remote host to connect to your X Server, that is, that the X Server accepts connection requests from that host.
You open an ssh session, that is, log into the remote host, set the DISPLAY variable to point to you laptop's X Server, and start a network-aware program.
You'll need of course a network connection from the remote host to the X Server: that is, your laptop. It can depend on the firewall/router settings. The SSH client can be used to tunnel the X-related network traffic.
There must be tons of X primers on the net.
I remember something about a system property called java.awt.headless. Ah, here's something google turns up:
Basically, you don't want the server to be thinking about monitors, keyboards and mice. And this property set to false tells it so.