Tuesday, March 18, 2014

SQL Developer : Unable to create an instance of the Java Virtual Machine

Have you ever got this error message with SQL Developer ?

"... Unable to create an instance of the Java Virtual Machine ..."

It usually appears the first time you try to launch "SQL Developer" ( I have also found others get similar message with JDeveloper). The error is related to the memory allocated for the  JVM associated with the program we are trying to launch.

There are two SQLDeveloper parameter settings for this purpose :

Add32VMOption  -Xms  and
Add32VMOption  -Xmx

Which can be set in the file product.conf located at (in windows):

C:\Documents and Settings\Administrator\Application Data\sqldeveloper\1.0.0.0.0

So, in my case all I had to do is apply the following changes in this file:

# SetJavaHome C:\Program Files\Java\jdk1.6.0_45 (not required but wanted to use latest JDK)
SetJavaHome C:\Program Files\Java\jdk1.7.0_51


# AddVMOption -Xms128m
AddVMOption -Xms256m

# AddVMOption -Xms800m
AddVMOption -Xmx512m

You finally get :