added conditional java-headless R