Java problem

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

sandermvdb
Posts: 160
Joined: Sat Jan 28, 2017 1:29 pm
Location: The Netherlands

Re: Java problem

Post by sandermvdb »

tpoppins wrote: Mon Nov 26, 2018 7:06 pm Guenther, the main reason I have JRE 8 installed is that we have some old 32-bit Java entries on our lists that have accumulated hundreds and thousands of games, it would be counter-productive to start testing their 64-bit versions as in my experience the gain is negligible -- unlike with C/C++ engines where going from 32-bit to 64-bit can be worth 20-50 Elo. I, too, may have run into some old engines not running under newer JREs but I don't have any examples in mind at the moment.
I think also in Java using 64 bits can improve the engine with 20-50 elo. Maybe the following table can take away the confusion:

Code: Select all

engine   compiler  runtime   result
32 bit   32 bit    32 bit    0 elo
32 bit   32 bit    64 bit    0 elo

64 bit   32 bit    32 bit    0 elo
64 bit   64 bit    32 bit    error
64 bit   64 bit    64 bit    +50 elo
The developer writes certain code and 'defines' if it is a 64-bit engine by using 64 bit datatypes. For optimal performance, this is compiled by the developer to a jar-file using a 64 bit compiler. In this case, the tester must use a 64 bit runtime (jre) to be able to run this engine.
A 32 bit engine (compiled using a 32 bit compiler) does run on a 64 bit runtime but there will be no performance gain.
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Java problem

Post by Guenther »

sandermvdb wrote: Sun Nov 25, 2018 9:40 am
Guenther wrote: Sat Nov 24, 2018 1:18 pm Ok I checked a few very old ones and they really throw an exception.
e.g. Eden_005 and Ronja_060 (despite being much more recent)
Currently I have only installed JDK 11.01.
Java versions are indeed backwards compatible. It is true that they removed some libraries from Java 11 to make it leaner. If these missing libaries are causing problems you can add them manually.
What error do you get?
Examples:

Code: Select all

0.000: - Starting server: java -jar Ronja070.jar
0.000: - Priority class set to normal
0.000: - Thread priority set to normal
0.249: < # Ronja version 0.7.0
0.312: < Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
0.312: < 	at se.dykstrom.ronja.engine.ui.Ronja.createGame(Ronja.java:71)
0.312: < 	at se.dykstrom.ronja.engine.ui.Ronja.main(Ronja.java:57)
0.312: < Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
0.312: < 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
0.312: < 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
0.312: < 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
0.312: < 	... 2 more
0.327: - Server closed
0.327: - Stopping server communication
0.343: - Closing log

Code: Select all

0.000: - Starting server: java -jar Ronja060.jar
0.016: - Priority class set to normal
0.016: - Thread priority set to normal
0.265: < # Ronja version 0.6.0
6.817: > xboard
9.891: > go
9.937: < Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
9.937: < 	at se.dykstrom.ronja.common.model.Game.<init>(Game.java:98)
9.937: < 	at se.dykstrom.ronja.common.model.Game.<init>(Game.java:43)
9.937: < 	at se.dykstrom.ronja.common.model.Game$Holder.<clinit>(Game.java:52)
9.937: < 	at se.dykstrom.ronja.common.model.Game.instance(Game.java:111)
9.937: < 	at se.dykstrom.ronja.engine.ui.command.GoCommand.execute(GoCommand.java:38)
9.937: < 	at se.dykstrom.ronja.engine.ui.Ronja.start(Ronja.java:62)
9.937: < 	at se.dykstrom.ronja.engine.ui.Ronja.main(Ronja.java:53)
9.937: < Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
9.937: < 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
9.937: < 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
9.937: < 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
9.937: < 	... 7 more
9.953: - Server closed
9.953: - Stopping server communication
9.953: - Closing log
0.000: - Starting server: java -jar Ronja060.jar
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
sandermvdb
Posts: 160
Joined: Sat Jan 28, 2017 1:29 pm
Location: The Netherlands

Re: Java problem

Post by sandermvdb »

Guenther wrote: Mon Nov 26, 2018 10:46 pm
Examples:

Code: Select all

0.000: - Starting server: java -jar Ronja070.jar
0.000: - Priority class set to normal
0.000: - Thread priority set to normal
0.249: < # Ronja version 0.7.0
0.312: < Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
0.312: < 	at se.dykstrom.ronja.engine.ui.Ronja.createGame(Ronja.java:71)
0.312: < 	at se.dykstrom.ronja.engine.ui.Ronja.main(Ronja.java:57)
0.312: < Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
0.312: < 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
0.312: < 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
0.312: < 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
0.312: < 	... 2 more
0.327: - Server closed
0.327: - Stopping server communication
0.343: - Closing log

Code: Select all

0.000: - Starting server: java -jar Ronja060.jar
0.016: - Priority class set to normal
0.016: - Thread priority set to normal
0.265: < # Ronja version 0.6.0
6.817: > xboard
9.891: > go
9.937: < Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
9.937: < 	at se.dykstrom.ronja.common.model.Game.<init>(Game.java:98)
9.937: < 	at se.dykstrom.ronja.common.model.Game.<init>(Game.java:43)
9.937: < 	at se.dykstrom.ronja.common.model.Game$Holder.<clinit>(Game.java:52)
9.937: < 	at se.dykstrom.ronja.common.model.Game.instance(Game.java:111)
9.937: < 	at se.dykstrom.ronja.engine.ui.command.GoCommand.execute(GoCommand.java:38)
9.937: < 	at se.dykstrom.ronja.engine.ui.Ronja.start(Ronja.java:62)
9.937: < 	at se.dykstrom.ronja.engine.ui.Ronja.main(Ronja.java:53)
9.937: < Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
9.937: < 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
9.937: < 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
9.937: < 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
9.937: < 	... 7 more
9.953: - Server closed
9.953: - Stopping server communication
9.953: - Closing log
0.000: - Starting server: java -jar Ronja060.jar
These errors are indeed caused by libraries which used to be part of the Java runtime environment but have been removed in later versions. This can be fixed by adding them manually but I don't know exactly how this can be done. An easier approach is that the engine is recompiled by the developer with these libraries included.
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Java problem

Post by Guenther »

sandermvdb wrote: Tue Nov 27, 2018 5:06 pm
Guenther wrote: Mon Nov 26, 2018 10:46 pm
Examples:

Code: Select all

0.000: - Starting server: java -jar Ronja070.jar
0.000: - Priority class set to normal
0.000: - Thread priority set to normal
0.249: < # Ronja version 0.7.0
0.312: < Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
...

0.000: - Starting server: java -jar Ronja060.jar
0.016: - Priority class set to normal
0.016: - Thread priority set to normal
0.265: < # Ronja version 0.6.0
6.817: > xboard
9.891: > go
9.937: < Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
These errors are indeed caused by libraries which used to be part of the Java runtime environment but have been removed in later versions. This can be fixed by adding them manually but I don't know exactly how this can be done. An easier approach is that the engine is recompiled by the developer with these libraries included.
Yes, I created an issue at the authors github repository.
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
chessman2b
Posts: 9
Joined: Fri Mar 07, 2014 3:50 pm

Re: Java problem

Post by chessman2b »

Oracle has changed the way that Java is being released and what is included in the release:

Java 8 is being supported for several more years (if you have a support contract) by Oracle because major companies depend on some features that have been removed.

There is now going to be a new version of Java released every 6 months. There will be a new LTS version (long term supported) version every 3 years.

So Java 8 will be supported for a long while.
Java 11 is the new LTS version and will be supported for at least the next 3 years with updates.
Version 12 will come out around march 2019 but it will only be supported till the next version comes out with security updates.

Problems for Chess Folks:

The biggest problem if you are trying to program something and run it locally is you will have to change how you compile and run it since Java will NOT be including a JRE beginning with version 11. (... there is no JRE for version 11 and won't be for any future versions). In the past you could have your end users download the java jre to run programs locally, but not now).
Gabor Szots
Posts: 1362
Joined: Sat Jul 21, 2018 7:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: Java problem

Post by Gabor Szots »

chessman2b wrote: Sun Dec 09, 2018 7:12 pm Oracle has changed the way that Java is being released and what is included in the release:

Java 8 is being supported for several more years (if you have a support contract) by Oracle because major companies depend on some features that have been removed.

There is now going to be a new version of Java released every 6 months. There will be a new LTS version (long term supported) version every 3 years.

So Java 8 will be supported for a long while.
Java 11 is the new LTS version and will be supported for at least the next 3 years with updates.
Version 12 will come out around march 2019 but it will only be supported till the next version comes out with security updates.

Problems for Chess Folks:

The biggest problem if you are trying to program something and run it locally is you will have to change how you compile and run it since Java will NOT be including a JRE beginning with version 11. (... there is no JRE for version 11 and won't be for any future versions). In the past you could have your end users download the java jre to run programs locally, but not now).
Very useful information, thank you.
Gabor Szots
CCRL testing group
User avatar
Graham Banks
Posts: 41423
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Java problem

Post by Graham Banks »

I had to go into the system environs and manually change the javapath to point to where I had the new java.
gbanksnz at gmail.com
sandermvdb
Posts: 160
Joined: Sat Jan 28, 2017 1:29 pm
Location: The Netherlands

Re: Java problem

Post by sandermvdb »

Best option for engine testers is to use OpenJDK I think. It is free and runs Java 11 binaries.
One drawback is that there is no executable so you have to add the java.exe manually to your path.
Gregory Owett
Posts: 249
Joined: Fri Mar 10, 2006 10:26 am
Location: France

Re: Java problem

Post by Gregory Owett »

Hi,
Java 11 is installed, however it is impossible to run your engine. Pity. There is not a simpler way to turn it ? :(
sandermvdb
Posts: 160
Joined: Sat Jan 28, 2017 1:29 pm
Location: The Netherlands

Re: Java problem

Post by sandermvdb »

Gregory Owett wrote: Mon Dec 10, 2018 6:50 pm Hi,
Java 11 is installed, however it is impossible to run your engine. Pity. There is not a simpler way to turn it ? :(
Running my engine with OpenJDK is not that difficult: download the OpenJDK, unzip the zip file, go to the bin folder and execute the following command:
java -jar [location of chess22k.jar]

If you want to be able to execute java.exe without navigating to the bin folder, you can add the OpenJDK bin folder to the system path in the Windows environment variables.