java 启动 Wildfly (JBoss) 服务器时出现 VM 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35244037/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 23:53:34  来源:igfitidea点击:

VM error while starting Wildfly (JBoss) server

javajboss

提问by Chirag Soni

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,

我有带 PATH 变量集的 wildfly-10.0.0.Final 可用。我正在使用 Ubuntu。我也有 jdk1.7.0_79。我面临的问题是,当我尝试启动正在执行 standalone.sh 的服务器时,我收到错误消息,

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

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

回答by Lukasz_Plawny

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

使用 jdk 1.8 而不是 jdk 1.7。MetaspaceSize 是 jdk 1.8 中为 Metaspace 添加的新标志。

回答by Zeigeist

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,

检查 java -version。如果它不是java 版本 "1.8.0_xx",则设置 JAVA_HOME 环境变量如下并运行命令,

bash-4.1$ export JAVA_HOME=LOCATION_TO_JDK1.8.0

bash-4.1$ 导出 JAVA_HOME=LOCATION_TO_JDK1.8.0

回答by JUAN DAVID DIAZ SOTO

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.

你必须在standalone.bat文件中这一行设置JAVA_HOME=C:\Program Files\Java\jdk-9.0.4,并更改JDK安装的ubication。