OptiFabric

OptiFabric

9M Downloads

"Failed to remap jar" due to exclamation mark in Windows user name

GreenGinkgo opened this issue ยท 0 comments

commented

I can already tell you exactly what the problem is, but I'm not a Java developer, so I don't know how to get around it...

It seems that in the process of trying to load the Optifine jar, OptiFabric attempts to use the PC user's temp directory (ex: C:\Users\JohnDoe\AppData\Local\Temp). However there is a VERY longstanding bug with Java where exclamation marks (maybe other punctuation too?) in file paths causes issues.

The problem here is that my username on this PC is "Clark!" so my user's temp folder path is "C:\Users\Clark!\AppData\Local\Temp." Java cannot understand that the exclamation mark (!) is part of the user path, and instead just chops it off and breaks. (see the "Caused by" line). My MC installation is on a separate drive, so it doesn't run into this issue. I understand it's dumb, and next time I install Windows, I won't make my username so exuberant...

Any chance we can just use a temp directory within the Minecraft folder instead?
And no, "please create a new Windows user without an exclamation mark" is not feasible or end-user friendly.

Thanks much!

Exception log:
java.lang.RuntimeException: Failed to remap jar at me.modmuss50.optifabric.mod.OptifineSetup.remapOptifine(OptifineSetup.java:234) at me.modmuss50.optifabric.mod.OptifineSetup.remapOptifine(OptifineSetup.java:219) at me.modmuss50.optifabric.mod.OptifineSetup.getRuntime(OptifineSetup.java:167) at me.modmuss50.optifabric.mod.OptifabricSetup.run(OptifabricSetup.java:46) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at com.chocohead.mm.Plugin.getMixins(Plugin.java:340) at org.spongepowered.asm.mixin.transformer.PluginHandle.getMixins(PluginHandle.java:128) at org.spongepowered.asm.mixin.transformer.MixinConfig.postInitialise(MixinConfig.java:796) at org.spongepowered.asm.mixin.transformer.MixinProcessor.prepareConfigs(MixinProcessor.java:568) at org.spongepowered.asm.mixin.transformer.MixinProcessor.select(MixinProcessor.java:462) at org.spongepowered.asm.mixin.transformer.MixinProcessor.checkSelect(MixinProcessor.java:438) at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:290) at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:414) at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323) at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218) at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:145) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:467) at net.fabricmc.loader.impl.util.DefaultLanguageAdapter.create(DefaultLanguageAdapter.java:50) at net.fabricmc.loader.impl.entrypoint.EntrypointStorage$NewEntry.getOrCreate(EntrypointStorage.java:117) at net.fabricmc.loader.impl.entrypoint.EntrypointContainerImpl.getEntrypoint(EntrypointContainerImpl.java:53) at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:47) at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35) at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:162) at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68) at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) Caused by: java.nio.file.AccessDeniedException: C:\Users\Clark at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:236) at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:484) at java.base/java.nio.file.Files.newOutputStream(Files.java:228) at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:162) at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getZipFileSystem(ZipFileSystemProvider.java:125) at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:106) at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:339) at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:288) at net.fabricmc.tinyremapper.OutputConsumerPath.<init>(OutputConsumerPath.java:113) at net.fabricmc.tinyremapper.OutputConsumerPath.<init>(OutputConsumerPath.java:47) at net.fabricmc.tinyremapper.OutputConsumerPath$Builder.build(OutputConsumerPath.java:76) at me.modmuss50.optifabric.mod.OptifineSetup.remapOptifine(OptifineSetup.java:227) ... 28 more