}
public void start() throws IOException
{
// setup vncserver on the provided display
XvncStartCommand xvncStart = new XvncStartCommand(startDisplay);
xvncStart.setProject(project);
LoggingUtil.log("Starting xvnc", true);
// execute the maximum number of cycle times before throwing an exception
while (xvncStart.execute() != 0)
{
LoggingUtil.log("Cannot start xnvc on :" + xvncStart.getCurrentDisplay() + ", cycling ...");
try
{
xvncStart.cycle();
}
catch (XvncException xe) {
throw new IOException(xe);
}
}
finalDisplay = xvncStart.getCurrentDisplay();
//setup player command to use the right display in its env when launching
playerCommand.setEnvironment(new String[]{ "DISPLAY=:" + finalDisplay });
LoggingUtil.log("Setting DISPLAY=:" + finalDisplay);