dhleong / judo

A more elegant way to play in the MUD
19 stars 2 forks source link

Can't build or run it on Windows #114

Open higoorc opened 1 year ago

higoorc commented 1 year ago

Downloading the latest version 1.15.3 the output of java -jar judo-{version}.jar is:

Exception in thread "main" java.lang.reflect.InaccessibleObjectException: Unable to make field transient java.util.LinkedHashMap$Entry java.util.LinkedHashMap.tail accessible: module java.base does not "opens java.util" to unnamed module @6483f5ae at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:180) at java.base/java.lang.reflect.Field.setAccessible(Field.java:174) at net.dhleong.judo.complete.LruCache.<init>(RecencyCompletionSource.kt:46) at net.dhleong.judo.complete.RecencyCompletionSource.<init>(RecencyCompletionSource.kt:13) at net.dhleong.judo.JudoCore.<init>(JudoCore.kt:145) at net.dhleong.judo.JudoMainKt.main(JudoMain.kt:95)

If I clone the project and try to build by myself, on main version, the output of gradlew jar is:

* What went wrong: Could not initialize class org.codehaus.groovy.runtime.InvokerHelper Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]

W10, JAVA version 18.0.1.1 2022-04-22.

dhleong commented 1 year ago

You may need to use an older version of Java 🤔 I took a reflection shortcut in RecencyCompletionSource.kt to get reverse iteration out of LinkedHashMap that newer versions of the runtime must not like. PRs welcome of course; I unfortunately do not have time to rebuild LinkedHashMap from scratch.

As far as gradlew jar not working... I'm at a loss. That looks like some kind of gradle internals issue