I have windows 10 how do you setup a java program in cutechess for example.
Java program:
https://github.com/sandermvdb/chess22k/ ... s/tag/1.14
How to run a java chess program in windows
Moderators: hgm, Dann Corbit, Harvey Williamson
-
Ferdy
- Posts: 4833
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
-
tmokonen
- Posts: 1284
- Joined: Sun Mar 12, 2006 6:46 pm
- Location: Kelowna
- Full name: Tony Mokonen
Re: How to run a java chess program in windows
You can use a batch file, same as you would in Arena.
I have the Java bin folder in my path, and my batch file contains one line:
java -Xmx1024M -jar chess22k-1.14.jar
Usually when you install Java, it places the Java bin folder in your path. If you don't have the Java bin folder in your path, your batch file would look more like:
"C:\Program Files\Java\jdk-14.0.1\bin\java.exe" -Xmx1024M -jar chess22k-1.14.jar
substituting C:\Program Files\Java\jdk-14.0.1\bin\ with wherever your Java executable is located.
Since the full path has spaces, I had to use the quotes. I usually configure engines to use 256MB of hash memory. You may have to increase the amount of memory specified in the -Xmx1024M command line parameter (here, a maximum of 1024 MiB of memory usage) if you want the engine to use more hash. You'd probably have to put quotes around the name of the .jar file, if the jar filename contains spaces.
And from within the CuteChess GUI:

I have the Java bin folder in my path, and my batch file contains one line:
java -Xmx1024M -jar chess22k-1.14.jar
Usually when you install Java, it places the Java bin folder in your path. If you don't have the Java bin folder in your path, your batch file would look more like:
"C:\Program Files\Java\jdk-14.0.1\bin\java.exe" -Xmx1024M -jar chess22k-1.14.jar
substituting C:\Program Files\Java\jdk-14.0.1\bin\ with wherever your Java executable is located.
Since the full path has spaces, I had to use the quotes. I usually configure engines to use 256MB of hash memory. You may have to increase the amount of memory specified in the -Xmx1024M command line parameter (here, a maximum of 1024 MiB of memory usage) if you want the engine to use more hash. You'd probably have to put quotes around the name of the .jar file, if the jar filename contains spaces.
And from within the CuteChess GUI:

-
Ferdy
- Posts: 4833
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: How to run a java chess program in windows
Thanks that one worked.tmokonen wrote: ↑Thu Jan 07, 2021 9:52 am You can use a batch file, same as you would in Arena.
I have the Java bin folder in my path, and my batch file contains one line:
java -Xmx1024M -jar chess22k-1.14.jar
Usually when you install Java, it places the Java bin folder in your path. If you don't have the Java bin folder in your path, your batch file would look more like:
"C:\Program Files\Java\jdk-14.0.1\bin\java.exe" -Xmx1024M -jar chess22k-1.14.jar
BTW what is "-Xmx1024M"?
-
tmokonen
- Posts: 1284
- Joined: Sun Mar 12, 2006 6:46 pm
- Location: Kelowna
- Full name: Tony Mokonen
Re: How to run a java chess program in windows
That's the maximum amount of memory that Java will use, technically the maximum heap size. It doesn't necessarily have to be included in the batch file, but in the past I had problems with some engines unless I explicitly included that option with a large enough amount of memory. Some engines are memory hogs, even beyond hash/opening book/neural net usage. Honestly, I'm a bit lazy, and I just copy batch files and change paths whenever I use a new Java program. When I run Chess22k using 256MB of hash, it uses 295,408K when I look at memory usage in the task manager, so 1024M is plenty in this case.
https://alvinalexander.com/blog/post/ja ... e-control/
Edit: Now that I've looked it up, it appears that 64MB is the default heap size, so you'll probably need it, unless you use a tiny hash table size.
-
Ferdy
- Posts: 4833
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: How to run a java chess program in windows
Ok I keep it there, I run engine only at 128MB for bullet tests.tmokonen wrote: ↑Thu Jan 07, 2021 10:19 amThat's the maximum amount of memory that Java will use, technically the maximum heap size. It doesn't necessarily have to be included in the batch file, but in the past I had problems with some engines unless I explicitly included that option with a large enough amount of memory. Some engines are memory hogs, even beyond hash/opening book/neural net usage. Honestly, I'm a bit lazy, and I just copy batch files and change paths whenever I use a new Java program. When I run Chess22k using 256MB of hash, it uses 295,408K when I look at memory usage in the task manager, so 1024M is plenty in this case.
https://alvinalexander.com/blog/post/ja ... e-control/
Edit: Now that I've looked it up, it appears that 64MB is the default heap size, so you'll probably need it, unless you use a tiny hash table size.