Java

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. 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.

=Advantages=
 * 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.

=Disadvantages= =Java Engines=
 * 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 >>>.
 * 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.
 * Category:Java :

=See also=
 * Generic Programming
 * Hyperbola Quintessence in Java
 * Java-Bitscan

=Books & Papers=

1995 ...

 * Gary McGraw, Ed Felten (1996). Java Security - Hostile Applets, Holes & Antidotes. John Wiley & Sons
 * Andrew Appel (1998). Modern Compiler Implementation in Java. Cambridge University Press
 * Liwu Li (1998). Java - Data Structures and Programming. Springer
 * Erik D. Demaine (1998). C to Java: Converting Pointers into References. Concurrency: Practice and Experience, Vol. 10, Nos. 11-13

2000 ...

 * Barbara Liskov, John Guttag (2000). Program Development in Java; Abstraction, Specification, and Object-oriented Design. Addison-Wesley
 * Raimond Reichert, Jürg Nievergelt, Werner Hartmann (2000). Ein spielerischer Einstieg in die Programmierung mit Java. Informatik Spektrum (German)
 * Patrick Winston, Sundar Narasimhan (2001). On To Java. 3rd edition
 * Yue Yang, Ganesh Gopalakrishnan, Gary Lindstrom (2002). Specifying Java Thread Semantics Using a Uniform Memory Model. Java Grande 2002, pdf
 * Andrew Appel, Jens Palsberg (2002). Modern Compiler Implementation in Java. 2nd edition, Cambridge University Press
 * Liwu Li (2004). Extending the Java Language with Dynamic Classification. Journal of Object Technology, Vol. 3, No 7

2005 ...

 * Liwu Li (2005). Implementing the π-Calculus in Java. Journal of Object Technology, Vol. 4, No. 2
 * Paul Fischer (2005). An Introduction to Graphical User Interfaces with Java Swing. Pearson Education, Addison-Wesley, Amazon.de » GUI
 * Leen Ammeraal, Kang Zhang (2007). Computer Graphics for Java Programmers, 2nd Edition, ISBN-13: 978-0-470-03160-5, John Wiley
 * David J. Barnes, Michael Kölling (2008, 2012). Objects First with Java: A Practical Introduction using BlueJ. Prentice Hall / Pearson Education
 * Carl Burch (2009). Programming via Java. On-line Book

2010 ...

 * Mark Watson (2016). Practical Artificial Intelligence Programming With Java. Sixth Edition » Artificial Intelligence

=Forum Posts=

1997 ...

 * Java chess program? by Robert Epps, rgcc, May 28, 1997
 * bitboards in java? by vitor, CCC, April 06, 1999 » Bitboards
 * Saboteur - A Java chess engine by Josh Levine, CCC, October 09, 1999 » Saboteur

2000 ...

 * ChessPartner Summer updates + Java chess by Lex Loep, CCC, July 11, 2000 » ChessPartner
 * Java vs. C++ Chess Programming Question by Sam Gross, CCC, May 15, 2001
 * Java versus C Speed Comparison by Graham Laight, CCC, January 06, 2003
 * Use of Java UCI/WB Chess Engines by Manfred Rosenboom, CCC, May 31, 2004
 * Java chess engines by Eydun Lamhauge, CCC, July 10, 2004
 * Java Application Server and Chess by Gerd Isenberg, CCC, September 15, 2004
 * Java Chess by William H. Rogers, CCC, April 12, 2007
 * Magic bitboards, Java by Sargon, CCC, August 19, 2007 » Magic Bitboards
 * Java & Magic Bitboards by Laurens Winkelhagen, Winboard Forum, February 03, 2009 » Magic Bitboards
 * OliThink GUI in Java... Complete source posted by Oliver Brausch, CCC, November 25, 2009 » OliThink, GUI

2010 ...

 * Winboard/Java help by Dan Honeycutt, CCC, April 22, 2012 » WinBoard
 * 32-bit and 64-bit java engines by Gabor Szots, CCC, February 14, 2014
 * Re: Yes by Roland Stuckardt, CCC, February 24, 2014 » Fischerle


 * java engines by Gabor Szots, CCC, October 28, 2015
 * Java problem! by Günther Simon, CCC, November 13, 2017
 * Bitboards and Java by Fred Hamilton, CCC, November 14, 2017 » Bitboards

=External Links=

Language

 * Java (programming language) from Wikipedia
 * Java applet from Wikipedia
 * Java virtual machine from Wikipedia
 * Generics in Java from Wikipedia
 * Java Native Interface from Wikipedia
 * log4j from Wikipedia
 * Java Basics Lessons by Fred Swartz
 * Java implementation of algorithms from Norvig and Russell's Artificial Intelligence: A Modern Approach. 3rd edition
 * Java IAQ: Infrequently Answered Questions by Peter Norvig
 * Lambda-search Java-code (version 2.0) by Thomas Thomsen » Lambda-Search
 * comp.lang.java

Chess Libraries

 * GitHub - ljgw/syzygy-bridge: Java bridge to use the Syzygy Tablebases via JNI by Laurens Winkelhagen » FrankWalter, Syzygy Bases

Video Tutorials

 * Simple Java Chess Engine Tutorial Series by Jonathan Warkentin, YouTube Videos


 * Advanced Java Chess Engine Tutorial Series by Jonathan Warkentin

=References= Up one Level