Wednesday, 3 August 2011

Fixing SQL Developer MSVCR71.DLL Not Found Error

Fixing SQL Developer MSVCR71.DLL Not Found Error:

I recently installed Oracle SQL Developer on a clean install of Windows 7 (64 bit). I had done this many times in the past with no problems, and so I was surprised when I went to run it and got this error:

This application failed to start because MSVCR71.dll was not found.

Wow. It’s been a while since I’ve seen that one.

Since this was a new install of Windows 7 I presumed the problem was simply that I didn’t have the Microsoft Visual C Runtime files. I went to Microsoft and installed the recommended CRT files. No joy. Still not working.

I searched my computer for the runtimes to see where the install put them, and found nothing in the Windows folders, but several hits under the sqldeveloper folders. So, the runtime was included with the Oracle SQL Developer files, but because its folder was not on the path, there was no way for it to be found. And the Microsoft runtime install, whatever it did, did not put the files where they could be found.

How is this supposed to work? The SQL Developer app is simply a zip file. You don’t install it. Just unzip it. But if needs the CRT files, and these files aren’t in the Windows folder, how is this going to work? How did it ever work?

I also found this note on Microsoft’s knowledge base:

For Msvcr70.dll or for Msvcr71.dll, you should install the CRT DLL into your application program files directory. You should not install these files into the Windows system directories.

OK. So the runtime installer did the right thing. But, again, how would this work? Clearly Oracle is depending on the runtimes being available (i.e. improperly installed) in their software distribution strategy for SQL Developer. But, as Microsoft tightens the reigns, and as people start obeying the rules, this approach falls short. You can’t simply distribute it as a zip file and expect it to work. You’re going to have to provide a little bit of configuration to get the runtimes on the path.

The Solution

To fix it, properly, you need to install SQL Developer yourself. Fortunately, this is simple.

  • · Run regedit as the Administrator
  • · Expand HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
  • · Add a new Key to App Paths called sqldeveloper.exe
  • · Set the (Default) value to the full path to the executable (including the executable name).
  • · Create a new String value for sqldeveloper.exe called Path and set its value to the jre / bin folder in the SQL Developer files or to the jre/bin folder installed in your system.

Yes, I could provide you a script to make all these registry entries for you, but you really shouldn’t trust a script that makes changes to your system like that. And, you need to learn how to configure a Windows application anyway.

This problem isn’t limited to Oracle SQL Developer. It will be common to any application distributed without an installation process that is dependent on a runtime file that was formerly located in the Windows folder.