Supported JDK - dn0000001/test-automation GitHub Wiki
JDK8 is the mainly supported JDK and tested against.
JDK16
JDK16 was tested to see if it can be supported. There are some libraries that need to be updated to at least compile using JDK16. The PR#326 fixed the compile issues.
JDK16 - Illegal reflective access
At runtime, "Illegal reflective access" issues will occur. This is due to changes in the JDK. This can only be worked around by adding the following JVM options:
--illegal-access=warn
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-opens java.base/java.text=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.desktop/java.awt.font=ALL-UNNAMED
--add-opens java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED
The illegal-access option will output any of the "Illegal reflective access" issues at run-time such that you might be able to fix them. If you remove this option, then any "Illegal reflective access" will cause a failure on any occurrence.
All the "Illegal reflective access" issues in the Framework Smoke Test Suite were resolved by adding the add-opens options. So, the illegal-access option should not be necessary but it is better to be safe and use it until it is removed.
Additionally, with JDK16 running tests via the IDE & data generation will fail due to "Illegal reflective access". It is necessary to add the options to perform these actions in the IDE after they fail the 1st time. It should be possible to add these options as default to TestNG Template for run configs.