18

I have wildfly-10.0.0.Final available with PATH variable set. I am using Ubuntu. Also I have jdk1.7.0_79. I am facing the problem that as when I am trying to start server that is executing standalone.sh then I am getting the error,

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

Chirag Soni
  • 437
  • 2
  • 5
  • 18

3 Answers3

26

Use jdk 1.8 instead of jdk 1.7. MetaspaceSize is a new flag added for Metaspace in jdk 1.8.

Lukasz_Plawny
  • 429
  • 7
  • 17
  • 5
    If you want to keep the current java version and use jdk 1.8 only for wildfly you can open standalone.conf.bat file in wildfly-10.0.0.Final\bin\ folder and uncomment the line with set "JAVA_HOME=C:\opt\jdk1.6.0_23" and change to ur location. – nanospeck Nov 01 '16 at 04:31
  • @nanospeck thanks this is great not to break your current JAVA_HOME config – Tom Dec 08 '16 at 14:00
  • After change java to 1.8 wildfly 10.1.0 also server works fine !! – Shalika Aug 31 '17 at 05:44
  • @Lukasz: Thanks. Saved the day! – Gaurav Aug 28 '18 at 11:00
1

Check java -version. If it is not java version "1.8.0_xx", then set the JAVA_HOME environment variable as below and run the command,

bash-4.1$ export JAVA_HOME=LOCATION_TO_JDK1.8.0

Zeigeist
  • 3,755
  • 3
  • 20
  • 22
-1

You have to put in the standalone.bat file this line set JAVA_HOME=C:\Program Files\Java\jdk-9.0.4, and change the ubication of the JDK installation.