if (!re.waitForR()) {
System.out.println("Cannot load R");
return;
}
System.out.println("re-routing stdout/err into R console");
System.setOut(new PrintStream(new RConsoleOutputStream(re, 0)));
System.setErr(new PrintStream(new RConsoleOutputStream(re, 1)));
System.out.println("Letting go; use main loop from now on");
}