From d7ca9c5637f488ced21788bde9df15fcf0c6644a Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 15 Aug 2014 15:24:21 -0400 Subject: [PATCH] Server launcher: Print errors running java -version to stderr We forward errors from the spawned server to stderr, so we are already using stderr and this should save someone some pain vs. just swallowing the fail. --- launch/src/main/scala/xsbt/boot/ServerApplication.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/launch/src/main/scala/xsbt/boot/ServerApplication.scala b/launch/src/main/scala/xsbt/boot/ServerApplication.scala index c8123bcb9..9194e1ff1 100644 --- a/launch/src/main/scala/xsbt/boot/ServerApplication.scala +++ b/launch/src/main/scala/xsbt/boot/ServerApplication.scala @@ -225,7 +225,9 @@ object ServerLauncher { val re = """java version "[0-9]+\.([0-9]+)\..*".*""".r lineOption flatMap { case re(v) => try Some(Integer.parseInt(v) > version) catch { case NonFatal(_) => None } - case other => None + case other => + System.err.println(s"Failed to parse version from 'java -version' output '$other'") + None } } finally { process.destroy() @@ -235,6 +237,7 @@ object ServerLauncher { case e: IOException => // both process.start and reading the output streams can throw IOException. // all OS exceptions from process.start are supposed to be IOException. + System.err.println(s"Failed to run 'java -version': ${e.getClass.getName}: ${e.getMessage}") None }