diff -r 8e89d567748c -r c449daa25b45 langtools/test/jdk/jshell/ToolBasicTest.java --- a/langtools/test/jdk/jshell/ToolBasicTest.java Fri May 20 09:47:00 2016 -0700 +++ b/langtools/test/jdk/jshell/ToolBasicTest.java Fri May 20 11:55:46 2016 -0700 @@ -569,4 +569,17 @@ return ex.getMessage(); } } + + public void testHeadlessEditPad() { + String prevHeadless = System.getProperty("java.awt.headless"); + try { + System.setProperty("java.awt.headless", "true"); + test( + (a) -> assertCommandOutputStartsWith(a, "/edit printf", "| Cannot launch editor -- unexpected exception:") + ); + } finally { + System.setProperty("java.awt.headless", prevHeadless==null? "false" : prevHeadless); + } + } + }