Issue
- 
After upgrading to JDK 11, Operations Center and/or Controllers fail to start with an issue like the following:
Unrecognized VM option '<JVM OPTION>' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
 
Environment
- 
CloudBees CI (CloudBees Core) on modern cloud platforms - Managed controller
 - 
CloudBees CI (CloudBees Core) on modern cloud platforms - Operations Center
 - 
CloudBees CI (CloudBees Core) on traditional platforms - Client controller
 - 
CloudBees CI (CloudBees Core) on traditional platforms - Operations Center
 
Explanation
Java 11 (and mainly Java 9) removes support for many Java options:
When upgrading from Java 8 to Java 9+, unsupported and deprecated options must be removed and if possible replaced.
| See CloudBees Supported Java Version for information about Java Versions support. | 
Resolution
Many of the previously recommended JDK 8 GC logging arguments are no longer supported:
- 
-Xloggc:${LOGDIR}/gc.log/-Xloggc:${LOGDIR}/gc-%t.log - 
-XX:NumberOfGCLogFiles=2 - 
-XX:+UseGCLogFileRotation - 
-XX:GCLogFileSize=100m - 
-XX:+PrintGC - 
-XX:+PrintGCDateStamps - 
-XX:+PrintGCDetails - 
-XX:+PrintHeapAtGC - 
-XX:+PrintGCCause - 
-XX:+PrintTenuringDistribution - 
-XX:+PrintReferenceGC - 
-XX:+PrintAdaptiveSizePolicy 
They must be replaced by the single -Xlog argument as documented in Prepare CloudBees CI for Support:
- 
-Xlog:gc*=info,gc+heap=debug,gc+ref*=debug,gc+ergo*=trace,gc+age*=trace:file=${LOGDIR}/gc.log:utctime,pid,level,tags:filecount=2,filesize=100M 
Where:
- 
filecount=2is the equivalent of the deprecated-XX:NumberOfGCLogFiles=2 - 
filesize=100Mis the equivalent of the deprecated-XX:GCLogFileSize=100m - 
file=${LOGDIR}/gc.log/file=${LOGDIR}/gc-%t.logis the equivalent of the deprecated-Xloggc:${LOGDIR}/gc.log/-Xloggc:${LOGDIR}/gc-%t.log - 
${LOGDIR}is an existing directory where operations center or controller can write log files, e.g./var/log/cloudbees-core-cm 
See also Java 11: Convert GC Logging Flags to Xlog and Java 11: Enable Logging with the JVM Unified Logging Framework for more details.
*Note: If the unsupported arguments is not among the one listed above, have a look at the following documentations to understand if it may simply be removed or what it may be replaced with: