当前位置: 代码迷 >> Ruby/Rails >> Unrecognized option: -jrockit Error: Could not create the Java Virtual Machine
  详细解决方案

Unrecognized option: -jrockit Error: Could not create the Java Virtual Machine

热度:604   发布时间:2016-04-29 02:12:37.0
Unrecognized option: -jrockit Error: Could not create the Java Virtual Machine.


Unrecognized option: -jrockit
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit


是weblogic 10.3.5 启动的时候抛出的一个错误


weblogic安装时选择的是开发模式,选用的jdk是jdk1.7,domain域创建的时候选择的jdk也是jdk1.7


在 %DOMAIN_HOME%\bin\startWebLogic.cmd 启动时出现的错误

具体错误信息为

starting weblogic with Java version:Unrecognized option: -jrockitError: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exit.Starting WLS with line:D:\DEV_ENV\Java7\JDK17~1.0_6\bin\java -jrockit   -Xms512m -Xmx512m -Dweblogic.Name=AdminServer -Djava.security.policy=D:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy  -Xverify:none  -da -Dplatform.home=D:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=D:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=D:\Oracle\MIDDLE~1\WLSERV~1.3\server   -Dweblogic.management.discover=true  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=D:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sysext_manifest_classpath;D:\Oracle\MIDDLE~1\patch_ocp360\profiles\default\sysext_manifest_classpath  weblogic.ServerUnrecognized option: -jrockitError: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exit.D:\Oracle\Middleware\user_projects\domains\dev_domain\bin>

出错地
Unrecognized option: -jrockitError: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exi

跟着错误找原因,第一处的错误的上面一行输出信息为

starting weblogic with Java version:

找到该行的脚本内容

echo starting weblogic with Java version:%JAVA_HOME%\bin\java %JAVA_VM% -versionif "%WLS_REDIRECT_LOG%"=="" (	echo Starting WLS with line:		echo %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%	%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%) else (	echo Redirecting output from WLS window to %WLS_REDIRECT_LOG%	%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%  >"%WLS_REDIRECT_LOG%" 2>&1 )


分析了下,怀疑是 %JAVA_VM%参数的问题


试着将脚本修改为

echo starting weblogic with Java version:echo %JAVA_VM%%JAVA_HOME%\bin\java %JAVA_VM% -versionif "%WLS_REDIRECT_LOG%"=="" (	echo Starting WLS with line:		echo %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%	%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%) else (	echo Redirecting output from WLS window to %WLS_REDIRECT_LOG%	%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%  >"%WLS_REDIRECT_LOG%" 2>&1 )

再启动,检验下 %JAVA_VM% 的参数内容
starting weblogic with Java version:-jrockitUnrecognized option: -jrockitError: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exit

证明, %JAVA_VM% 的内容是-jrockit,这是之前bea时候开发的一个jdk,现在用的是sun的jdk,这个参数不识别。

最简单的修改方式,把启动脚本中的 %JAVA_VM% 去掉就可以了


将脚本修改为

<pre name="code" class="html">echo starting weblogic with Java version:%JAVA_HOME%\bin\java -versionif "%WLS_REDIRECT_LOG%"=="" (	echo Starting WLS with line:		echo %JAVA_HOME%\bin\java %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%	%JAVA_HOME%\bin\java %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%) else (	echo Redirecting output from WLS window to %WLS_REDIRECT_LOG%	%JAVA_HOME%\bin\java %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%  >"%WLS_REDIRECT_LOG%" 2>&1 )

可以正常启动了。



  相关解决方案