Caveat: At the release of this wiki page, Java 14 is the current released Java Development Kit (JDK).
Every project will require the usage of at least one Java Development Kit (JDK). This is the source, root or core of the code that will be used in each project. It may be a fast decision to just select the most recent JDK; though this might end in frustration or confusion during the build process. This wiki will go over the different JDK versions and distributions. Yes, even distributions are different! Distributions are provided by various companies and may be missing or have added features from the root JDK. This wiki pages objectives are to remove any confusion about which version or distribution to use.
Various distributions from vendors existed prior to Oracle changing its licensing structure and were used for varying reasons; such as using a variation of the Java Virtual Machine (JVM) for performance. So what does this mean for you as a developer for yourself or your company? Well we have good news about which JDK to choose. Lucky free open source distributions exist for commercial use. These will be listed in Distributions.
With the change of the licensing model Oracle also updated their release pipeline to now include regular feature updates at a faster rate. The overall goal of the JDK development team is to move forward with the bigger Java Enhancement Proposals (JEPs) (Valhalla, Panama) by working out the foundational JEPs. Some smaller but related features that are foundational to the bigger JEPs are (Records, Sealed Classes) will be released inbetween the major features.
Since each platform that Java works on is different the code translation may leaves features out or incapable of being emulated from the desktop to mobile or web. Thus is developing on a specific platform you actually may not have much of a choice on which Java versions. As a developer you may also be faced with having to use multiple JDKs to support the features and/or debugging capabilities required by the project. Most of the versions listed will be Long Term Supported (LTS). Hot swapping code is a feature that allows one to compile and swap code during runtime debugging. This feature enhanced by using Dynamic Code Execution Virtual Machine (DCEVM). This is technically a separate distribution DCEVM. Some developers will use JDK 8 for language compatibility, JDK 11 for DCEVM and JDK 14 for packaging.
Version | Desktop | Android | iOS | HTML | DCEVM | ARM | Notes |
---|---|---|---|---|---|---|---|
7 | X | X | X | X | X | ||
8 | X | X | X | X | X | LTS - Most compatible | |
9 | X | X | Modules - Oracle Licensing Changed | ||||
11 | X | X | X | LTS & HTML Support with 3rd Party Backend | |||
15 | X | JPackage | |||||
16 | TBD - March - Sept 2021 | ||||||
17 | TBD - Sept 2021 - ? (LTS) |
Out of these versions it is recommended to use LTS versions & distributions. This way any issues that arise in the JDK will probably be fixed or supported by the companies involved in the JDK maintenance.
Now this wiki went over the background on distributions. Let's see which are available and recommended. JDKs info sourced from sdkman.io - JDKs and other libGDX developers.