Voidious / RoboRunner

Multi-threaded Robocode battle runner.
Other
8 stars 4 forks source link

Broken in JDK12 #1

Open jkflying opened 4 years ago

jkflying commented 4 years ago

I tried to run this under OpenJDK12 on Ubuntu 18.04 and Robocode 1.9.3.7, and I'm getting a weird error

It's crashing at https://github.com/Voidious/RoboRunner/blob/83023c9dfcffa060a2a9346830561d9611b7693e/src/robowiki/runner/BattleRunner.java#L66 with a NPE, and if I add a processOutput == null || it hangs on engine initialization forever.

Voidious commented 4 years ago

Oh ok, thanks! I will try to take a look soon.

jkflying commented 4 years ago

Got a bit further, it seems if I get all of the .jar files onto the classpath as per https://sourceforge.net/p/robocode/bugs/407/ at least it doesn't crash.

jkflying commented 4 years ago

That seems to have fixed it. So I guess it just needs adding all of the classpaths to the rr.sh. It was a bit of a pain to debug because the stdout of the subprocesses doesn't get printed :-)

jkflying commented 4 years ago

So it ends up needing something like:

RRCP=lib/guava-12.0.1.jar
for f in robocodes/r1/libs/*.jar; do
    RRCP=$RRCP:$f
done

java -cp $RRCP .....
bumfo commented 4 years ago

Got a bit further, it seems if I get all of the .jar files onto the classpath as per https://sourceforge.net/p/robocode/bugs/407/ at least it doesn't crash.

confirmed from here, robocode bug #407 can be resolved by adding all required jars explicitly.

bumfo commented 4 years ago

So it ends up needing something like:

RRCP=lib/guava-12.0.1.jar
for f in robocodes/r1/libs/*.jar; do
    RRCP=$RRCP:$f
done

java -cp $RRCP .....

Maybe we can do something cleaner than the hack, e.g.

https://cgjennings.ca/articles/java-9-dynamic-jar-loading/