Search code examples
scalasbt

Unrecognized VM option 'CMSClassUnloadingEnabledn-J-Xmx2Gn'


I have installed scala, sbt on Mac. When I try to run sbt it gives an error Unrecognized VM option 'CMSClassUnloadingEnabledn-J-Xmx2Gn'. I think there is an issue with JVM but could not find any help for this error.

More error info: Did you mean '(+/-)CMSClassUnloadingEnabled'? Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.


Solution

  • My guess is that the sbt configuration is confused with regards to line breaks and mangles something like

    -J-XX:+CMSClassUnloadingEnabled
    -J-Xmx2G
    

    into one line