From Chessprogramming wiki
Revision as of 16:59, 4 February 2019 by GerdIsenberg (talk | contribs)
Jump to: navigation, search

Home * Programming * Languages * Java

Java has been developed by Sun Microsystems since 1991 and is mostly connected with James Gosling. The aim was to design a language that uses as virtual machine and is thus capable to run on any OS. The initial goal was that Java can be also used to control all devices as coffee machines. But he the fact that Java was quite free and OS independent has made Java very popular [1]. And so the environment has grown to several platforms for normal programming (SE), Enterprise Programming (EE) and Mobile Programming (ME). The most important aspect is that Java compiles to a bytecode. And this bytecode is then interpreted by virtual machine, or JIT compiled. And Java is a object oriented language with a lot of additional feature as a good security concept, reflection, annotations, generics, etc. For chess programming Java has lots of advantages but also some disadvantages.


  • The usage of a virtual machine makes Java chess programs able to run on any OS as Windows or Linux.
  • Java uses garbage collection. So the programmer doesn't need to care of memory allocation and freeing.
  • The Java Ecosystem is very big. There are millions of free tools as IDEs (Eclipse, NetBeans), TestTools, Profilers, CodeCoverage, Error- and Architecture Checkers, automatic BuildSystems, and so on...
  • Java is a good OO language with lots of modern features and tools like embedded databases (db4o, hsqldb, H2, etc.) that might be useful for chess openings.


  • Java was long time called a slow engine. Especially by game developers who needed fast graphics speed. In fact Java wasn't designed to deliver fast graphics. But on the other hand Java is not that slow as most people expected. It is one of the fastest vm languages available. A look on benchmarks like the shootout shows that Java is fast. Unfortunately it is about 2-10 times slower that pure C or C++. So in order to have the best engine performance, most developers tend to use C and C++ and not Java.
  • The Java environment can not easily generate *.exe files that represent chess engines. So a bat file has to be called to run the java vm. And this can make trouble in some Chess GUIs.
  • Java has no unsigned long data type that is e.g. used by bitboards. Thus one has to use unsigned right shift operator >>> [2] [3].
  • The Java garbage collector makes ram usage and the response time a little non-deterministic. But this is mostly not regarded as a real problem for chess developers.

Java Engines

See also

Books & Papers

1995 ...

2000 ...

2005 ...

2010 ...

Forum Posts

1997 ...

2000 ...

2010 ...

Re: Yes by Roland Stuckardt, CCC, February 24, 2014 » Fischerle

External Links


Chess Engines

Video Tutorials


Up one Level