Saturday, March 22, 2014

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

While working with a client, after client installed all the required softwares, WLS, Jdeveloper and JDK on the machines , there was an error which came up on starting integrated weblogic server from Jdeveloper. That error was something like below :-

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



So first time when application is started from jdeveloper, it creates a domain by asking admin password to be set. The domain got created successfully and DefaultDomain folder was there in system.x.x.x. folder but integrated weblogic server was not starting up


On Analysing setDomainEnv.sh shell script , below code is where seems to be the problem and which is generating the errror.


if [ "${JAVA_VENDOR}" = "Sun" ] ; then
EXTRA_JAVA_PROPERTIES="-XX:+UseParallelGC -XX:+DisableExplicitGC ${EXTRA_JAVA_PROPERTIES}"
export EXTRA_JAVA_PROPERTIES
else
if [ "${JAVA_VENDOR}" = "Oracle" ] ; then
EXTRA_JAVA_PROPERTIES="-Djrockit.codegen.newlockmatching=true ${EXTRA_JAVA_PROPERTIES}"
export EXTRA_JAVA_PROPERTIES
else
EXTRA_JAVA_PROPERTIES="-XX:+UseParallelGC -XX:+DisableExplicitGC ${EXTRA_JAVA_PROPERTIES}"
export EXTRA_JAVA_PROPERTIES
fi
fi


Now this code in the script clearly shows , that the parameter JAVA_VENDOR is being set to Oracle.
Due to this, the option -DJrockit is used while running the Integrated Weblogic Service.


Now a simple workaround for this is to manually hardcode JAVA_VENDOR variable to Sun before the if statement or maybe at the starting of the script where this kind of if logic starts. But this will be work around. If system.x.x. folders gets deleted and on starting the Integrated Weblogic server, again new DefaultDomain will get created which again will be having JAVA_VENDOR set as Oracle.


So the root cause of this error is the JDK Mess Up. Jdeveloper 11g needs JDK 6 to run and if by any chance there is JDK 7 installed and Jdev is reffering to that, this error is likely to come. This by somehow changes JAVA_VENDOR variable to Oracle.

The solution to this problem is that when Jdeveloper is being installed, JDK  6 needs to be used which is bundled up with Jdeveloper and verify that Jdeveloper uses JDK 6 everytime.

Same goes for JDK 7 for Jdeveloper 12C.






1 comment:

  1. BlueHost is ultimately the best hosting company with plans for all of your hosting requirements.

    ReplyDelete