i am able to run multiSnmpToolClient.jar in windows environment.But when i run same application in linux environment i am getting below exception.
can anybody suggest why i am facing the below exception in linux environment.
[root@apgsdl001 tmp]# java -jar multiSnmpToolClient.jar
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(Unknown Source)
at java.awt.Window.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at javax.swing.JFrame.<init>(Unknown Source)
at com.bt.multiSnmpTool.MultiSnmpToolClient.<init>(MultiSnmpToolClient.java:236)
at com.bt.multiSnmpTool.MultiSnmpToolClient.<init>(MultiSnmpToolClient.java:262)
at com.bt.multiSnmpTool.MultiSnmpToolClient.main(MultiSnmpToolClient.java:1927)
Are you running this in a windowed environment like Gnome or KDE, or from a server? If it is the latter, try adding the following parameter to the JVM itself (so before the class name): -Djava.awt.headless=true. See http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/
Good to see your reply.
Following is the command which i tried to run my client jar :
[root@apgsdl001 tmp]# java -Djava.awt.headless=true -jar multiSnmpToolClient.jar
Exception in thread "main" java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(Unknown Source)
at java.awt.Window.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at javax.swing.JFrame.<init>(Unknown Source)
at com.bt.multiSnmpTool.MultiSnmpToolClient.<init>(MultiSnmpToolClient.java:236)
at com.bt.multiSnmpTool.MultiSnmpToolClient.<init>(MultiSnmpToolClient.java:262)
at com.bt.multiSnmpTool.MultiSnmpToolClient.main(MultiSnmpToolClient.java:1927)
Even i make enable before my jar file when i run "-Djava.awt.headless=true" it is showing the above exception.
Can you suggest if i am doing any mistake.
yekkala krishna wrote:I am connecting to my solaris system with the help of putty.Is it right?
And there is the problem. PuTTy is a text-only client, and it is simply unable to show the user interface. To be able to this you'll need to connect to the Solaris machine's windowing server - if it has any. I remember doing this a few years ago in Linux, where I connected to a remote X server. For Windows there are clients for this as well, although the only one I can think of is Exceed. That one is definitely not free though. You may find something else using Google.
Of course this does require the Solaris machine to a) have a windowing server (like X11 or Xorg), and b) make it accessible for your client machine. For both you will need to contact your system administrator.
yekkala krishna wrote:I am connecting to my solaris system with the help of putty.Is it right?
And there is the problem. PuTTy is a text-only client, and it is simply unable to show the user interface. To be able to this you'll need to connect to the Solaris machine's windowing server - if it has any. I remember doing this a few years ago in Linux, where I connected to a remote X server. For Windows there are clients for this as well, although the only one I can think of is Exceed. That one is definitely not free though. You may find something else using Google.
Of course this does require the Solaris machine to a) have a windowing server (like X11 or Xorg), and b) make it accessible for your client machine. For both you will need to contact your system administrator.
Actually, it's easier than that. Cygwin includes an X11 Server which you can run on the Windows machine, and it's free.
In your Putty settings, you need to make sure you allow X11 Forwarding (In the Putty settings, this is under Connection -> SSH -> Tunnels). When you connect to the host using SSL, it will set your DISPLAY environment variable to point to a special proxy display (usually something like localhost:10.0).
You don't need to be running any X11 server software on the *nix host at all. When you run the X client application on the host, it uses the proxy display (localhost:10.0) which forwards all the X stuff to your X Server running on the windows machine.
And if you don't want to install Cygwin then there is always
XMing.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Mark E Hansen
Ranch Hand
Joined: Apr 01, 2009
Posts: 639
posted
0
Remember that you don't have to install all of Cygwin. You can install just the minimum, plus the X11 stuff you want.
I had problems when I tried XMing, but I can't remember now what they were. Perhaps it's time to try it again!
Mark E Hansen wrote:Remember that you don't have to install all of Cygwin. You can install just the minimum, plus the X11 stuff you want.
I had problems when I tried XMing, but I can't remember now what they were. Perhaps it's time to try it again!
I use it without problems in XP installed on Sun Virtual Box hosted on Ubuntu 9.10 and 10.04.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.