SFS2X Docs / AdvancedTopics / jre-compatibility
» Java Runtime (JRE) Compatibility
At the time of writing this article (April 2023) SmartFoxServer 2X ships with an embedded 64-bit JRE v11, allowing to run the server without the need of external dependencies. Previous releases (< 2.18.0) were bundled with a 64-bit JRE v8.
SFS2X can also run with a range of alternative Java runtimes, including more recent versions and from different vendors. In this short guide we provide a map of which JREs can be used and the process to replace the default runtime.
» Supported vendors
We have tested SmartFoxServer 2X with different Java Runtimes from multiple vendors and we can recommend the following:The embedded JRE v11 provided in SmartFoxServer 2X is an AdoptJDK distribution. They offer a wide range of pre-built JREs/JDKs supporting all platform and architectures (ARM included) and they are our current go-to provider.
» Supported Java versions
If you need to deploy Java code that relies on a more recent JDK release you can refer to the following compatibility table.
JDK Version | End of free updates | Supported |
JDK 8 (LTS) | 2026 AdoptJDK and Corretto | YES |
JDK 9 | March 2018 | YES |
JDK 10 | September 2018 | YES |
JDK 11 (LTS) | 2024 AdoptJDK, 2027 Corretto | YES |
JDK 12 | September 2019 | YES |
JDK 13 | March 2020 | YES |
JDK 14 | September 2020 | YES |
JDK 15 | March 2021 | YES (*) |
JDK 16 | September 2021 | Requires extra config (*) |
JDK 17 (LTS) | 2027 AdoptJDK, 2029 Corretto | Requires extra config (*) |
JDK 18 | September 2022 | Requires extra config (*) |
JDK 19 | March 2023 | Requires extra config (*) |
JDK 20 | September 2023 | Requires extra config (*) |
JDK 21 (LTS) | 2029 Temurin, 2030 Corretto | Requires extra config (*) |
Unless you're bound to specific JDK versions we highly recommend sticking with an LTS release.
(*) = since Java 15 for the Nashorn JavaScript engine has been dropped, so it's no longer possible to run JS Extensions.
Further Java Release details
For a more detailed list of the changes in each Java release we highly recommend this Wikipedia summary.
» Replacing the default Java Runtime
To replace the default JRE with a new one you can follow these simple steps:- Download the JRE matching your OS and architecture from your chosen vendor.
- Stop SmartFoxServer 2X, if it is running.
- Replace the default jre/ folder found under the main SmartFoxServer_2X/ directory.
- Start SmartFoxServer 2X and check the logs to make sure the boot was successful.
» Running with a JRE >= 16
As showed in the table starting with JRE 16 and higher requires extra settings to run SFS2X. These changes need to be applied to the launcher scripts and are very simple to implement.
We have a dedicated article in our blog with all the details to get you started.