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 :




18 comments:

  1. Thanks Jorge, you saved my day.
    In our company we have "only" 32bit Win7 with 4 gb ram.

    ReplyDelete
  2. Thanks. This worked for me.
    - Volowski

    ReplyDelete
  3. Worked for me as well. Thanks a lot.

    ReplyDelete
  4. Fix still good - September 2014 - many thanks

    ReplyDelete
  5. Thanks Jorge, It's working :)
    -Sameer

    ReplyDelete
  6. Hi, for Windows 7, there is no longer any Documents & Settings, and no product.conf file stored in appdata.
    You will need to change the sqldeveloper.conf file:
    “{ORACLE_HOME}\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf"

    Add the 2 options as mentioned :
    AddVMOption -Xmx512m
    AddVMOption -Xms256m

    That worked for me - Liz

    ReplyDelete
  7. Thanks!, can you explain the why?. Thanks again

    ReplyDelete
    Replies
    1. Hi there. Not sure about the reasons for this to be an issue. But fortunately we found a workaround. Thanks for your feedback.
      regards

      Delete
  8. Thanks very much... its very short & clean explanation....

    ReplyDelete
  9. thank you :) your explantation save me time

    ReplyDelete
  10. thkns so much but only 2 thing that maybe works only in my case
    1. the directory is C:\sqldeveloper\ide\bin ('c' is where i put sqldeveloper) and the file is ide.conf
    2. i only have "SetJavaHome" but not the rest, what i do is before to "SetJavaHome" put inmediatly "C:\Program Files\Java\jdk1.7.0_51" without quotes
    the memery is the same in your case and voila... it works!!!

    ReplyDelete
  11. Thanks. This piece of information helped me today. Appreciate your time in writing this article - VJ

    ReplyDelete
  12. at which line can I add it at the end

    ReplyDelete
  13. In my case the problem was from TeamViewer. Closed that app and SqlDeveloper started normaly.

    ReplyDelete
  14. In my case problem was TeamViewer. After closing that app, SqlDeveloper started normaly. No need to change any config files.

    ReplyDelete
  15. Hi,

    I am not able to find # AddVMOption -Xms128m
    AddVMOption -Xms256m this files.

    Can anybody help?

    ReplyDelete