Question
I have an application written in Java. It is designed to work offline on a Linux box. I am trying to create a new firefox window. However, firefox never opens. It always has a shell exit code of 1. I can run the same code using gnome-terminal, and it opens perfectly.
Background
So here is his initialization process:
- Start X "Xorg: 1 -br -terminate -dpms -quiet vt7"
- Window Launch Manager "metacity --display =: 1 --replace"
- Configuring xrdb -merge / etc / X11 / Xresources resources
- Become a demon and disconnect from the control terminal
As soon as the program starts, a button will appear that the user can click to display the firefox window. Here is my code for this. Remember that X is on the display: 1.
code
public boolean openBrowser()
{
try {
Process oProc = Runtime.getRuntime().exec( "/usr/bin/firefox --display=:1" );
int bExit = oProc.waitFor();
return true;
} catch ( Exception e ) {
oLogger.log( Level.WARNING, "Open Browser", e );
return false;
}
}