Cross-posting a bug I helped someone with on Reddit: https://www.reddit.com/r/projectzomboid/comments/i3bva6/crash_on_startup/
Also affected this user: https://theindiestone.com/forums/index.php?/topic/29393-crashes-before-getting-onto-game/
I don't know what version they're using.
zombie.core.logger.ZipLogs.addZipFile(ZipLogs.java:29) needs to have an exception handler so that a corrupt ~/Zomboid/logs.zip file does not result in a crash on startup.
In the event of a corrupt zip file, the logs.zip file needs to be deleted and a new one created in its place.
Stack trace:
Exception in thread "main" java.util.zip.ZipError: zip END header not found
at com.sun.nio.zipfs.ZipFileSystem.zerror(ZipFileSystem.java:1605)
at com.sun.nio.zipfs.ZipFileSystem.findEND(ZipFileSystem.java:1021)
at com.sun.nio.zipfs.ZipFileSystem.initCEN(ZipFileSystem.java:1030)
at com.sun.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:130)
at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:117)
at java.nio.file.FileSystems.newFileSystem(FileSystems.java:326)
at java.nio.file.FileSystems.newFileSystem(FileSystems.java:276)
at zombie.core.logger.ZipLogs.addZipFile(ZipLogs.java:29)
at zombie.gameStates.MainScreenState.main(MainScreenState.java:108)
Workaround:
User needs to delete ~/Zomboid/logs.zip
P.S: Zomboid shouldn't store its data in that folder. https://stackoverflow.com/questions/11113974/what-is-the-cross-platform-way-of-obtaining-the-path-to-the-local-application-da?noredirect=1&lq=1 is better. Minecraft stores its data inside local app data. At the very least, Zomboid should store its stuff in ~/Documents.