• Examples (iOS)
• Examples (Java/Android)
• Examples (C++)
Server API Documentation

 

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

JDK Logos

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

NOTE: keep in mind that since the introduction of the 6 months release cycle, Java will get a new update twice a year. However only LTS releases get security and fix updates for several years after launch, while non-LTS versions are technically supported for 6 months only.
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 (*)

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:
macOS users only: the location of the JRE is different from Windows and Linux. The default Java runtime is located under SmartFoxServer_2X/ in the .install4j/jre.bundle/Contents/Home/ folder.

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