I'm solving dependencies for an open source java project and I can't find to what jar this import belongs, maybe it's a special JDK it belongs to?
import com.sun.nio.zipfs.ZipFileSystem;
Could you please help me?
I'm solving dependencies for an open source java project and I can't find to what jar this import belongs, maybe it's a special JDK it belongs to?
import com.sun.nio.zipfs.ZipFileSystem;
Could you please help me?
Based on what I can see,
com.sun.nio.zipfs.ZipFileSystemclass was not part of the official Java SE libraries.In Java 6 and earlier, the class does not exists
In Java 7 and Java 8, the class is in the "demo" suite.
In Java 9 and later, the class is no longer present in the "demo" suite ... but there is now a class called
jdk.nio.zipfs.ZipFileSystemin thejdk.zipfsmodule. However the class is not exposed by the module, and it is declared as package private. You are supposed to access it using theFileSystems.getFileSystemmethod.So to port your code to Java 9+, you need to add that module to your Java 9+ module dependencies (if your code is modular). Then you remove the
ZipFileSystemimport and replace it with an import forjava.nio.FileSystem. Finally change your code get aFileSystemobject by callingFileSystems.getFileSystemwith a URI with the schemejar:.There is more information about the Zip Filesystem Provider in the Java SE documentation; e.g.