Tools > Preferences > File Types
.sql, click 'Open with SQL Developer'
Is that checked already?
Yes it is.I checked that setting a while ago and it used to work. It seem to have broken recently when I installed DataModeler. In fact, I just unzipped DataModeler and it seems to be loaded dynamically inside SQL Developer.
You do not say anything about the version of SQL Developer in use, your OS, etc.
In general, however, if the OS environment does not respond to a change in the SQL Developer preference setting, you will need to tell the OS which application to associate with the .sql file type. In Windows 7, for example,
1. In Explorer, right-click on any sql file
2. In Properties > General tab > Change button
3. Choose a listed application or browse to select the SQL Developer to associate.
SQL Developer Team
I have the same problem - windows 7 64 bit, sqldeveloper 220.127.116.11, jdk 64bit 7 update 55.
I have tried deleting and recreating the .sql registry entry, setting and unsetting the preference in windows preferences and sqldeveloper.
If no sqldeveloper is open, it will start sqldeveloper and open the sql file with a double click, once it is open however, I get a 'working' cursor for a moment, then nothing.
Dragging and dropping files from an explorer window does work however.
Same experience... rebooting has worked before but not now.
Reading over andy1234's experience, I decided to try deleting/recreating the various registry entries relating to ...
1. .sql > shell > open > command
2. .sql > OpenWith...
3. And perhaps some other sqldeveloper references in the registry (it all starts to blur after awhile!)
Bottom line, for SQL Developer 4.0.2...
1. Using a 32-bit jdk, double-click on a .sql file launches the product initially and also opens successive .sql files.
2. Using a 64-bit jdk, double-click on a .sql file launches the product initially and will not open successive .sql files.
In doing this, I did not rely on the SQL Developer preference, just basic WIndows file extension associations. Possibly the 64-bit case can be made to open successive .sql files (hack the install to skip the top level sqldeveloper.exe which directs whether a 32-bit or 64-bit jdk is used). But this sounds too complicated and confusing. Since drag & drop works (with an open worksheet or other open connection viewer as the target), just relying on the launch plus successive drag & drop actions should suffice for the 64-bit case.
thanks a lot for the insight, now we know the cause of this strange behaviour.
I've encountered a similar issue previously, but instead I got a crash as I already reported in this thread Re: sqldeveloper64W.exe has stopped working
Strangely enough, this morning I have uninstalled a spare JDK7u55 I had installed for other reasons and now I can open the .sql files by double clicking on them regardless if SQLDev is running or not (please note that I am using SQLDev 4.0.2 bundled with the JDK).
One question though:
is the SQL developer 4.0.2 download marked "Windows 64-bit - zip file includes the JDK 7" packaged with the 32bit JDK or with the 64bit JDK?
It is packaged with the 64-bit JDK. Note the difference in the java -version output for a 32-bit vs a 64-bit JDK, i.e., Client VM vs Server VM...
32-bit JDK (installed from jdk-7u65-windows-i586.exe)
C:\Program Files (x86)\Java\jdk1.7.0_65\bin>.\java -version
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b19)
Java HotSpot(TM) Client VM (build 24.65-b04, mixed mode, sharing)
64-bit JDK (packaged in sqldeveloper-18.104.22.168.21-x64.zip)
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
Thanks for you help with this issue. It's currently working now. I had upgraded the JDK on my client.
Java version “1.7.0_40”
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java Hotspot(TM) 64-Bit Server (build 24.0-b56, mixed mode)
Java version “1.7.0_67”
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java Hotspot(TM) 64-Bit Server (build 24.65-b04, mixed mode)
It did not however work until a recent reboot.