Linux – Error Starting wildfly-10.0.0 on CentOS 7

centos7javajbosslinuxwildfly8

I have Install JDK 8 and wildfly-10.0.0 and when I try to start stat server using following command via terminal and getting following error.

sudo /opt/wildfly/bin/./launch.sh

Error

Starting Wildfly in standalone mode.
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/wildfly

  JAVA: java

  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

Unrecognized VM option 'MetaspaceSize=96M'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Best Answer

JAVA: java
...
Unrecognized VM option 'MetaspaceSize=96M'

Your (default) java version does not recognise the JDK 8 specific option MetaspaceSize and borks before tripping over the MaxMetaspaceSize option it also won't recognize.

You might have different JDK's installed with the default pointing to a JDK 6 or 7 and should try setting an explicit path to the correct java binary for your JDK 8 install.