From b9758d2201655cecfdda48660e77c598c52fcd9b Mon Sep 17 00:00:00 2001 From: "Archie L. Cobbs" Date: Wed, 4 Jan 2023 17:32:33 +0000 Subject: [PATCH] 8200610: Compiling fails with java.nio.file.ReadOnlyFileSystemException Reviewed-by: vromero --- .../classes/com/sun/tools/javac/main/JavaCompiler.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java index 47e70f5321f..387b34533e0 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java @@ -26,6 +26,9 @@ package com.sun.tools.javac.main; import java.io.*; +import java.nio.file.FileSystemNotFoundException; +import java.nio.file.InvalidPathException; +import java.nio.file.ReadOnlyFileSystemException; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -1682,7 +1685,11 @@ public class JavaCompiler { } if (results != null && file != null) results.add(file); - } catch (IOException ex) { + } catch (IOException + | UncheckedIOException + | FileSystemNotFoundException + | InvalidPathException + | ReadOnlyFileSystemException ex) { log.error(cdef.pos(), Errors.ClassCantWrite(cdef.sym, ex.getMessage())); return;