diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/ByteCodeGenerator.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/ByteCodeGenerator.java index 94957ba3202..ef969bf0f55 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/ByteCodeGenerator.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/ByteCodeGenerator.java @@ -78,7 +78,7 @@ class ByteCodeGenerator extends TestsGenerator { } catch (Throwable t) { Path errFile = generatorDir.resolve(mainClassName + ".err"); try (PrintWriter pw = new PrintWriter(Files.newOutputStream(errFile, - StandardOpenOption.CREATE_NEW))) { + StandardOpenOption.CREATE, StandardOpenOption.WRITE))) { t.printStackTrace(pw); } catch (IOException e) { t.printStackTrace();