Bot dont start Local Java


#1

Hello every one,

i cant start the Bot on my Local Machine.
If i start the run…bat i get this error Message

Turn 1

================================================================
error: failed to decode bot message: “a” (at position 2)
Last input received was:
at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Error: A JNI error has occurred, please check your installation and try again

Exception in thread “main”

Thx for Help
Klatuu


#2

It looks like Java can’t start the bot. Are you able to run java MyBot in the console from that directory?


#3

I have a similar Problem:

Turn 1
================================================================
error: timed out after 2000 ms (when reading string)
Last input received was:

console output:


#4

@Janphr same question: does java MyBot work?


#5

not sure, how do i check it? if i run it in IDE it waits for the input.
my python version works just fine.


#6

Just try running java MyBot instead of ./run_game.bat.


#7

same as in IDE



#8

Hmm, that is right. Perhaps edit run_game.bat to use java -cp . MyBot instead of java MyBot (or, if you’re running halite.exe directly, make the same change).


#9

finally got it, these are all the changes i made:

javac -sourcepath G:\Dropbox\Java\workspace\halite\src MyBot.java
G:\Dropbox\Java\workspace\halite\src\halite.exe --replay-directory replays/ -vvv --width 32 --height 32 "java -cp . MyBot" "java -cp . MyBot"
pause

biggest problem for most might be, that there is no space between MyBot.java and halite.exe in the original bat file -> MyBot.javahalite.exe. you might wanna edit that.
rest are probably local environment problems…but it works like this for me now.
thanks for your help