The following code
try (FileSystem memFs = Jimfs.newFileSystem()) {
Path memFsRoot = memFs.getPath("");
URI uri = memFsRoot.toUri();
Path path = Paths.get(uri);
System.out.println("memFsRoot: " + memFsRoot);
System.out.println("uri: " + uri);
System.out.println("path: " + path);
}
prints, on Windows:
memFsRoot:
uri: jimfs://4dbef289-e533-4340-8531-fe2cc6b2f0f3/C:/work/
path: C:\work
This seems like a bug (even though the Path object is linked to the FileSystem instance). The path should not need the C: drive designation, as far as I can tell, because the GUID in the URI should be sufficient to locate the filesystem. The weird Jimfs URI and Path syntax makes porting code between Linux and Windows problematic.
On Linux the output is:
memFsRoot:
uri: jimfs://4dbef289-e533-4340-8531-fe2cc6b2f0f3/work/
path: /work