в ноутбуке 17 jdk и все отлично компилируется.
package com.javarush.task.task31.task3103;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
/*
Своя реализация
*/
public class Solution {
public static byte[] readBytes(String fileName) throws IOException {
byte[] bbb = Files.readAllBytes(Path.of(fileName));
return bbb;
}
public static List<String> readLines(String fileName) throws IOException {
List<String> lines = new ArrayList<>();
Path path = Path.of(fileName);
lines.add(Files.readAllLines(path).toString());
return lines;
}
public static void writeBytes(String fileName, byte[] bytes) throws IOException {
Files.write(Path.of(fileName), bytes);
}
public static void copy(String resourceFileName, String destinationFileName) throws IOException {
Files.copy(Path.of(resourceFileName), Path.of(destinationFileName));
}
}