tags:

views:

639

answers:

3

I am running a simple java client through java <class file> command. The java command is actually invoked by a system process. This is on Unix.

We were facing problem with X11 Display. So we added export DISPLAY=:0.0 in the startup file and the Display problem was resolved. Now when the export DISPLAY=:0.0 line is removed from the startup file and the java client is run again, we are not able to revert to old state, i.e., we no longer get the X11 Display error. So there is something that is persisting on the system. Is there any way to make sure the JVM context was killed before running the client?

We have killed the process that triggers the java client, then restarted the process to run the java client again. But not succeeded to go back to the old state.

[Edit] I forgot to mention that I have already tried "unset DISPLAY" in the stop file. The startup fie is run when the environment is brought up and the stop file is run when the environment is brought down. I have also tried headless mode but that doesn't work for our program.

+2  A: 

You probably set the DISPLAY environment in the shell. Try typing "export DISPLAY=" or "unset DISPLAY".

Paul Tomblin
A: 

Did you try to unset DISPLAY in your startup file ?

WiseTechi
+3  A: 

If you have previously executed the export command in the current shell (from the startup file, even), then the value is in your environment. Unsetting it (or getting a new shell with a clean environment) is the only way to get rid of the environment setting.

I would suggested adding a line to your startup script to echo $DISPLAY, so that it will be obvious what is currently set while you're troubleshooting the problem.

If your process doesn't actually need the xwindows display, you should start the JVM in headless mode. Details are here.

Jared
I forgot to mention that I have already tried "unset DISPLAY" in the stop file. The startup fie is run when the environment is brought up and the stop file is run when the environment is brought down. I have also tried headless mode but that doesn't work for our program.
Vicky
Did you add the echo of $DISPLAY to the startup script (preferrably right before the call to java) so that you can confirm that it is set/unset as you believe it is?
Jared
I'm not super-familiar with bash (a tcsh man myself)....does "unset" remove it from the environment, or do you have to "unset" then "export" the now-unset variable?
Jared