java.nio.file.InvalidPathException: Illegal char at index 2:

problem is that Paths.get() doesnt expect that kind of value which is generated from uri.getPath().

Solution:

URI uri = ClassLoader.getSystemResource("com/stackoverflow/json").toURI();
String mainPath = Paths.get(uri).toString();
Path path = Paths.get(mainPath ,"Movie.class");

Leave a Comment