Older Version
Newer Version
GerdIsenberg
Feb 25, 2018
[[toc]] **[[Home]] * [[Programming]] * [[Languages]] * Java** **Java** has been developed by [[Sun Microsystems]] since 1991 and is mostly connected with [[https://en.wikipedia.org/wiki/James_Gosling|James Gosling]]. The aim was to design a language that uses as [[https://en.wikipedia.org/wiki/Virtual_machine|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 <ref>[[http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html|TIOBE Index]]</ref>. And so the environment has grown to several platforms for normal programming ([[https://en.wikipedia.org/wiki/Java_Platform,_Standard_Edition|SE]]), Enterprise Programming ([[https://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Edition|EE]]) and Mobile Programming ([[https://en.wikipedia.org/wiki/Java_Platform,_Micro_Edition|ME]]). The most important aspect is that Java compiles to a [[https://en.wikipedia.org/wiki/Bytecode|bytecode]]. And this bytecode is then interpreted by virtual machine, or [[https://en.wikipedia.org/wiki/Just-in-time_compilation|JIT compiled]]. And Java is a [[https://en.wikipedia.org/wiki/Object_oriented|object oriented]] language with a lot of additional feature as a good security concept, [[https://en.wikipedia.org/wiki/Reflection_(computer_science)|reflection]], annotations, [[https://en.wikipedia.org/wiki/Generics_in_Java|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 [[https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)|garbage collection]]. So the programmer doesn't need to care of [[https://en.wikipedia.org/wiki/Dynamic_memory_allocation|memory allocation]] and freeing. * The Java **Ecosystem** is very big. There are millions of free tools as [[https://en.wikipedia.org/wiki/Integrated_development_environment|IDEs]] ([[https://en.wikipedia.org/wiki/Eclipse_(software)|Eclipse]], [[https://en.wikipedia.org/wiki/NetBeans|NetBeans]]), TestTools, [[https://en.wikipedia.org/wiki/Profiler_(computer_science)|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 ([[https://en.wikipedia.org/wiki/Db4o_(object_database)|db4o]], [[https://en.wikipedia.org/wiki/HSQLDB|hsqldb]], [[https://en.wikipedia.org/wiki/H2_(DBMS)|H2]], etc.) that might be useful for chess openings. =Disadvantages= * 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 [[http://dada.perl.it/shootout/|shootout]] shows that Java is fast. Unfortunately it is about 2-10 times slower that pure [[C]] or [[Cpp|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|bitboards]]. Thus one has to use [[https://chessprogramming.wikispaces.com/General+Setwise+Operations#Shifting%20Bitboards|unsigned right shift operator >>>]] <ref>[[https://groups.google.com/d/msg/rec.games.chess.computer/o3AMPvhmY3o/1yZhMk3_VlIJ|Re: Java chess program?]] by [[Moritz Berger]], [[Computer Chess Forums|rgcc]], May 29, 1997 » [[General Setwise Operations#ShiftingBitboards|Shifting Bitboards]]</ref> <ref>[[http://www.talkchess.com/forum/viewtopic.php?t=65724|Bitboards and Java]] by [[Fred Hamilton]], [[CCC]], November 14, 2017</ref>. * 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. [[#JavaEngines]] =Java Engines= Dynamic list of Java [[Engines|engines]] including Java ports with [[Guidance for Creating New Pages#Tags|tag]] '[[https://chessprogramming.wikispaces.com/tag/view/javaengines|javaengines]] <ref>[[http://www.talkchess.com/forum/viewtopic.php?t=58080|java engines]] by [[Gabor Szots]], [[CCC]], October 28, 2015</ref>': > [[include component="pageList" hideInternal="true" tag="javaengines" limit="200" ]] =See also= * [[Generic Programming]] * [[Hyperbola Quintessence#Java|Hyperbola Quintessence in Java]] * [[Java-Bitscan]] =Books & Papers= ==1995 ...== * [[https://en.wikipedia.org/wiki/Gary_McGraw|Gary McGraw]], [[Ed Felten]] (**1996**). //[[https://openlibrary.org/books/OL7612897M/Java_Security|Java Security - Hostile Applets, Holes & Antidotes]]//. [[https://en.wikipedia.org/wiki/John_Wiley_%26_Sons|John Wiley & Sons]] * [[Andrew Appel]] (**1998**). //[[https://www.cs.princeton.edu/~appel/modern/java/|Modern Compiler Implementation in Java]]//. [[https://en.wikipedia.org/wiki/Cambridge_University_Press|Cambridge University Press]] * [[Liwu Li]] (**1998**). //[[https://link.springer.com/book/10.1007%2F978-3-642-95851-9|Java - Data Structures and Programming]]//. [[https://en.wikipedia.org/wiki/Springer_Science%2BBusiness_Media|Springer]] ==2000 ...== * [[Barbara Liskov]], [[https://en.wikipedia.org/wiki/John_Guttag|John Guttag]] (**2000**). //[[http://www.amazon.com/Program-Development-Java-Specification-Object-Oriented/dp/0201657686/ref=sr_1_1?s=books&ie=UTF8&qid=1344621866&sr=1-1|Program Development in Java; Abstraction, Specification, and Object-oriented Design]]//. [[https://en.wikipedia.org/wiki/Addison-Wesley|Addison-Wesley]], ISBN-13: 978-0201657685 * [[http://beat.doebe.li/bibliothek/p01018.html|Raimond Reichert]], [[Jürg Nievergelt]], [[http://beat.doebe.li/bibliothek/p00342.html|Werner Hartmann]] (**2000**). //[[http://beat.doebe.li/bibliothek/t02012.html|Ein spielerischer Einstieg in die Programmierung mit Java]]//. Informatik Spektrum (German) * [[Patrick Winston]] (**2001**). //[[http://people.csail.mit.edu/phw/Books/index.html#OnToJava|On To Java]]//. * [[http://dblp.uni-trier.de/pers/hd/y/Yang:Yue|Yue Yang]], [[http://dblp.uni-trier.de/pers/hd/g/Gopalakrishnan:Ganesh|Ganesh Gopalakrishnan]], [[Gary Lindstrom]] (**2002**). //Specifying Java Thread Semantics Using a Uniform Memory Model//. [[http://dblp.uni-trier.de/db/conf/java/java2002.html#YangGL02|Java Grande 2002]], [[http://formalverification.cs.utah.edu/yyang/papers/umm_old.pdf|pdf]] * [[Andrew Appel]], [[http://dblp.uni-trier.de/pers/hd/p/Palsberg:Jens|Jens Palsberg]] (**2002**). //[[http://www.cambridge.org/catalogue/catalogue.asp?isbn=9780521820608|Modern Compiler Implementation in Java]]//. 2nd edition, [[https://en.wikipedia.org/wiki/Cambridge_University_Press|Cambridge University Press]] * [[Liwu Li]] (**2004**). //[[http://www.jot.fm/contents/issue_2004_07/article2.html|Extending the Java Language with Dynamic Classification]]//. [[https://en.wikipedia.org/wiki/The_Journal_of_Object_Technology|Journal of Object Technology]], Vol. 3, No 7 ==2005 ...== * [[Liwu Li]] (**2005**). //[[http://www.jot.fm/issues/issue_2005_03/article5/|Implementing the π-Calculus in Java]]//. [[https://en.wikipedia.org/wiki/The_Journal_of_Object_Technology|Journal of Object Technology]], Vol. 4, No. 2 <ref>[[https://en.wikipedia.org/wiki/%CE%A0-calculus|π-calculus from Wikipedia]]</ref> * [[Paul Fischer]] (**2005**). //An Introduction to Graphical User Interfaces with Java Swing//. [[https://en.wikipedia.org/wiki/Pearson_Education|Pearson Education]], [[https://en.wikipedia.org/wiki/Addison-Wesley|Addison-Wesley]], [[http://www.amazon.de/Introduction-Graphical-User-Interfaces-Swing/dp/0321220706|Amazon.de]] » [[GUI]] * [[Leen Ammeraal]], [[http://www.utdallas.edu/~kzhang/|Kang Zhang]] (**2007**). //[[http://home.planet.nl/%7Eammeraal/grjava2e.html|Computer Graphics for Java Programmers, 2nd Edition]]//, ISBN-13: 978-0-470-03160-5, [[http://eu.wiley.com/WileyCDA/Section/id-300022.html|John Wiley]] * [[Mark Watson]] (**2008**). //Practical Artificial Intelligence Programming With Java//. Third Edition, [[http://www.markwatson.com/opencontent_data/JavaAI3rd.pdf|pdf]] <ref>[[https://github.com/mark-watson|Mark Watson · GitHub]]</ref> » [[Artificial Intelligence]] * [[David J. Barnes]], [[https://en.wikipedia.org/wiki/Michael_K%C3%B6lling|Michael Kölling]] (**2008, 2012**). //[[http://www.bluej.org/objects-first/|Objects First with Java: A Practical Introduction using BlueJ]]//. [[https://en.wikipedia.org/wiki/Prentice_Hall|Prentice Hall]] / [[https://en.wikipedia.org/wiki/Pearson_PLC|Pearson Education]] * [[http://ozark.hendrix.edu/~burch/|Carl Burch]] (**2009**). //[[http://www.toves.org/books/java/index.html|Programming via Java]]//. On-line Book =Forum Posts= ==1997 ...== * [[https://groups.google.com/d/msg/rec.games.chess.computer/o3AMPvhmY3o/sh0xjWnVyHMJ|Java chess program?]] by Robert Epps, [[Computer Chess Forums|rgcc]], May 28, 1997 * [[http://www.stmintz.com/ccc/index.php?id=48176|bitboards in java?]] by vitor, [[CCC]], April 06, 1999 » [[Bitboards]] * [[http://www.stmintz.com/ccc/index.php?id=72423|Saboteur - A Java chess engine]] by [[Josh Levine]], [[CCC]], October 09, 1999 » [[Saboteur]] ==2000 ...== * [[http://www.stmintz.com/ccc/index.php?id=118709|ChessPartner Summer updates + Java chess]] by [[Lex Loep]], [[CCC]], July 11, 2000 » [[ChessPartner]] * [[http://www.stmintz.com/ccc/index.php?id=169936|Java vs. C++ Chess Programming Question]] by Sam Gross, [[CCC]], May 15, 2001 * [[http://www.stmintz.com/ccc/index.php?id=275303|Java versus C Speed Comparison]] by Graham Laight, [[CCC]], January 06, 2003 * [[http://www.stmintz.com/ccc/index.php?id=368309|Use of Java UCI/WB Chess Engines]] by Manfred Rosenboom, [[CCC]], May 31, 2004 * [[http://www.stmintz.com/ccc/index.php?id=375592|Java chess engines]] by Eydun Lamhauge, [[CCC]], July 10, 2004 * [[http://www.stmintz.com/ccc/index.php?id=387745|Java Application Server and Chess]] by [[Gerd Isenberg]], [[CCC]], September 15, 2004 * [[http://www.talkchess.com/forum/viewtopic.php?t=13046|Java Chess]] by [[William H. Rogers]], [[CCC]], April 12, 2007 * [[http://www.talkchess.com/forum/viewtopic.php?t=15896|Magic bitboards, Java]] by Sargon, [[CCC]], August 19, 2007 » [[Magic Bitboards]] * [[http://www.talkchess.com/forum/viewtopic.php?t=30793|OliThink GUI in Java... Complete source posted]] by [[Oliver Brausch]], [[CCC]], November 25, 2009 » [[OliThink]], [[GUI]] ==2010 ...== * [[http://www.talkchess.com/forum/viewtopic.php?t=43411|Winboard/Java help]] by [[Dan Honeycutt]], [[CCC]], April 22, 2012 » [[WinBoard]] * [[http://www.talkchess.com/forum/viewtopic.php?t=51279|32-bit and 64-bit java engines]] by [[Gabor Szots]], [[CCC]], February 14, 2014 > [[http://www.talkchess.com/forum/viewtopic.php?t=51279&start=3|Re: Yes]] by [[Roland Stuckardt]], [[CCC]], February 24, 2014 » [[Fischerle]] * [[http://www.talkchess.com/forum/viewtopic.php?t=58080|java engines]] by [[Gabor Szots]], [[CCC]], October 28, 2015 * [[#9]][[http://www.talkchess.com/forum/viewtopic.php?t=65718|Java problem!]] by [[Günther Simon]], [[CCC]], November 13, 2017 * [[http://www.talkchess.com/forum/viewtopic.php?t=65724|Bitboards and Java]] by [[Fred Hamilton]], [[CCC]], November 14, 2017 » [[Bitboards]] =External Links= ==Language== * [[https://en.wikipedia.org/wiki/Java_%28programming_language%29|Java (programming language) from Wikipedia]] * [[https://en.wikipedia.org/wiki/Java_applet|Java applet from Wikipedia]] * [[https://en.wikipedia.org/wiki/Java_virtual_machine|Java virtual machine from Wikipedia]] * [[https://en.wikipedia.org/wiki/Generics_in_Java|Generics in Java from Wikipedia]] * [[http://java.sun.com/j2se/1.5.0/docs/api/overview-summary.html|API specification for the Java 2 Platform Standard Edition 5.0.]] by [[https://en.wikipedia.org/wiki/Sun_Microsystems|Sun]] * [[https://en.wikipedia.org/wiki/Log4j|log4j from Wikipedia]] * [[http://www.onjava.com/pub/a/onjava/2005/02/02/bitsets.html|Bitwise Optimization in Java: Bitfields, Bitboards, and Beyond]] by [[Glen Pepicelli]], 2005, [[https://en.wikipedia.org/wiki/O%27Reilly_Media|O'Reilly's]] [[http://onjava.com/|OnJava.com]] » [[Bit-Twiddling]], [[Bitboards]] * [[http://leepoint.net/JavaBasics/index.html|Java Basics Lessons]] by [[Fred Swartz]] * [[http://leepoint.net/notes-java/index.html|Java Programming Notes]] by [[Fred Swartz]] * [[http://www.fdg.unimaas.nl/educ/donkers/games/gameslib/|Java Games Research Library]] by [[Jeroen Donkers]] * [[http://code.google.com/p/aima-java/|Java implementation of algorithms]] from [[Peter Norvig|Norvig]] and [[Stuart Russell|Russell's]] //[[http://aima.cs.berkeley.edu/|Artificial Intelligence: A Modern Approach]]//. 3rd edition * [[http://norvig.com/java-iaq.html|Java IAQ: Infrequently Answered Questions]] by [[Peter Norvig]] * [[http://www.t-t.dk/go/cg2000/code20.html|Lambda-search Java-code (version 2.0)]] by [[Thomas Thomsen]] » [[Lambda-Search]] * [[http://groups.google.com/group/comp.lang.java/topics|comp.lang.java]] ==Chess Engines== * [[https://sourceforge.net/projects/sjce/files/chess_engines_nb-src/|Strong Java Chess Engines Game - Browse /chess_engines_nb-src at SourceForge.net]] ==Video Tutorials== * [[http://www.youtube.com/playlist?list=PLQV5mozTHmaffB0rBsD6m9VN1azgo5wXl|Simple Java Chess Engine Tutorial Series]] by [[Jonathan Warkentin]], [[https://en.wikipedia.org/wiki/YouTube|YouTube]] Videos > [[media type="custom" key="24864756"]] * [[http://www.youtube.com/playlist?list=PLQV5mozTHmacMeRzJCW_8K3qw2miYqd0c|Advanced Java Chess Engine Tutorial Series]] by [[Jonathan Warkentin]] =References= <references /> =What links here?= [[include page="Java" component="backlinks" limit="200"]] **[[Languages|Up one Level]]**