Choosing the right JDK for WildFly and JBoss EAP

This tutorial discusses the recommended JDK versions to be used for WildFly and JBoss Enterprise Application Platform (EAP) and how to set the Java version for it.

The modularization of the JVM that began with Java 9 had a significant impact on a complex server like WildFly, particularly in the areas of classloading and reflection, both of which are extensively used. Since the early days of Java 9 development the WildFly team has worked to ensure that not only the WildFly code itself, but also the integrated libraries would all run well on the later generation JVMs.

Currently the minimum version required to run a recent version of WildFly (15-21) is Java 8 (Oracle JDK or OpenJDK).

More specifically, each server release has a minimum requirement and also a “maximum” version, which is the last JDK version on which the application server has been tested. You should therefore use any JDK in Min-Max range from the following table:

WildFly Version Min. JDK Max JDK
15 8 11
16 8 12
17 8 13 (Early stages testing)
18 8 13
19 8 13
20 8 13
21 8 13
22 8 13
23 8 13
24 8 13
25 8 17
26 8 17
27-30 11 17

That being said, which is the recommended JDK version for WildFly ?There are two main options:

  • WildFly versions up to 26 should run on the most recent long-term support release (LTS), i.e. on Java 8 and 11. On a balance, due to the amount of tests, it is recommended to use JDK 11.
  • WildFly version 27 drops support for Java 8. So you can mainly choose between Java 11 and Java 17. Much the same way, we recommend using the latter (Java 17) for running WildFly 27.

JBoss Enterprise Application Server 7

In order to be running in a supported configuration, JBoss EAP must be running in one specific Technology Compatibility Kit (TCK) certified implementations and on one of the operating systems supported by that implementation. In terms of JDK, here is the list of supported ones, in respect to each JBoss EAP 7 version and RHEL 7:

JBoss EAP
Supported JDKs
7.1.0 Oracle JDK 1.8 – Open JDK 1.8 – IBM JDK 1.8
7.2.0 Oracle JDK 1.8 and 11 – Open JDK 1.8 and 11 – IBM JDK 1.8
7.3.0 Oracle JDK 1.8 and 11 – Open JDK 1.8 and 11 – IBM JDK 1.8 – Eclipse OpenJ911
7.40 Oracle JDK 1.8 and 11. – IBM JDK 1.8.x – Eclipse OpenJ9 11 – Open JDK 1.8 and 11 
Azul Zulu 8.58 – 11.52 – Azul Zulu Prime 1.8.0_302 – 11.0.12
8.x Java 11 / Java 17

Source: https://access.redhat.com/articles/2026253

How to set the Java version in JBoss or WildFly

Configuring the JDK version in standalone mode is straightforward. If you look in the bin folder of your server installation, you will find the scripts standalone.conf (standalone.conf.bat for Windows users).

You can use these script files for a variety of purposes such as setting JVM settings; here is for example how to change the JVM settings on a Linux machine to use the J2SE 8 MaxMetaspace parameter:

JAVA_OPTS="-Xms64m -Xmx1024m -XX:MaxMetaspaceSize=256M"

To know how to configure JVM settings in Domain mode, we recommend looking at this article: How to configure WildFly in Domain mode

Disclaimer

This website is independently operated and is not affiliated with or maintained by Red Hat. The views expressed here are solely those of the author at the time of writing. It’s strongly recommended to consult Red Hat’s official website or seek professional guidance from Red Hat or certified professionals before implementing JBoss EAP in your systems. The author does not assume responsibility for any decisions or actions taken based on the information provided on this website.