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...
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.
2 Answers
I faced the same issue after I ran the command I ran this command: echo '-J-XX:+CMSClassUnloadingEnabled\n-J-Xmx2G\n' >> /usr/local/etc/sbtopts. It seems the file /usr/local/etc/sbtopts contained both options in same line, separated by \n, i.e. the actual contents of the file were -J-XX:+CMSClassUnloadingEnabled\n-J-Xmx2G\n
The solution was to remove \n by editing this file, and pressing enter key instead, so that the contents of file /usr/local/etc/sbtopts look the way David mentioned in his response.
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