I built a quite fat JavaFX application (the JAR is about 128 MB) and I got no problem in running in through IntelliJ. But when I run it from the terminal my 3D model loaders (Fxyz3d library) launch this exception.
Exception in thread "JavaFX Application Thread" java.nio.file.FileSystemNotFoundException
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:172)
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:158)
at java.base/java.nio.file.Path.of(Path.java:208)
at java.base/java.nio.file.Paths.get(Paths.java:98)
at org.fxyz3d.importers.obj.ObjImporter.read(ObjImporter.java:115)
at org.fxyz3d.importers.obj.ObjImporter.loadAsPoly(ObjImporter.java:102)
at org.fxyz3d.importers.Importer3D.loadIncludingAnimation(Importer3D.java:160)
at org.fxyz3d.importers.Importer3D.loadAsPoly(Importer3D.java:80)
at it.polimi.ingsw.PSP50.View.GUI.GuiView.lambda$startingGame$1(GuiView.java:201)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
This is thrown only for the 3D-object Loader from the Fxyz3d library, not for my other normal FXML loaders. I'm using the same way to get the files from my src/main/resources folder, that is getClass().getResource. So is this really a path issue? or is it a library issue? In IntelliJ there's no problem at all instead, it all works fine. Here it's the part of the code that doesn't work:
Model3D boardModel = Importer3D.loadAsPoly(getClass().getResource("/boardcliff2.obj"));
If anyone has encountered something like this before and knows what it going on, help would be really appreciated