Monday, January 24, 2011

Fix Squirrel-SQL Install on Windows 7 64-bit

I wanted to evaluate the latest SquirrelSQL client on a Windows 7 64-bit desktop, so I downloaded the latest 3.2.1 version from the Squirrel-SQL SourceForge web site, and attempted to install the JAR file.

Once I had the squirrel-sql-3.2.1-install.jar, I simply tried to execute it in order to install Squirrel-SQL, but I quickly encountered some errors and issues preventing me from installing it.

Solving this particular bug...
So, what is causing this and how to fix this error?  Turns out you need to install the JAR file with administrator privileges.  But, Windows does not give you an easy "run JAR as administrator" or "install JAR as administrator" option from Windows Explorer.  So, here is what you need to do:
  • open up an administrator command prompt
  • navigate to the directory you have the squirrel-sql-3.2.1-install.jar file in
  • execute this command: java -jar squirrel-sql-3.2.1-install.jar
  • you should now step through the install... I installed it to: C:\Program Files\squirrel-sql-3.2.1
  • but,...
  • at the end of the install you may see the following error, which oddly enough does not seem to prevent Squirrel-SQL from working:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.izforge.izpack.panels.ShortcutPanel.isValidated(Unknown Source)
at com.izforge.izpack.installer.IzPanel.panelValidated(Unknown Source)
at com.izforge.izpack.installer.InstallerFrame.navigateNext(Unknown Source)
at com.izforge.izpack.installer.InstallerFrame.navigateNext(Unknown Source)
at com.izforge.izpack.installer.InstallerFrame$NavigationHandler.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Don't you just love such informative messages?!  NOT!

Running SquirrelSQL Now...
That stack-trace aside,at least Squirrel is working enough for me to evaluate it as a universal SQL-client now (I am first trying it with SQL-Server 2008R2; connected just fine).

To run it, you should be able to simple double-click (from Windows Explorer) the file: squirrel-sql.bat (in the C:\Program Files\squirrel-sql-3.2.1 directory it was installed to)

It has some nice features for data-scripting and other things... time to start playing with it.  I hope this helps someone else get past the issues with installing on 64-bit Windows 7 (and, here's hoping a better installer comes out in future releases).

15 comments:

Anonymous said...

That just saved me a lot of time, thanks for sharing.

Anonymous said...

I just downloaded the jar file fro sourceforge and when I run the jar, everything goes fine until I am asked "Select the installation path". The default value is "C:\Program Files\squirrel-sql-3.3.0". When I click "Next" I get a warning dialog - "This directory cannot be written! Please choose another directory!"

No matte what directory I choose, I get this error. Can anyone help please?

Mike Eberhart said...

Anonymous,
Are you running on Win7x64 or some other OS? Also, did you do the "run as administrator" approach?

Also, I have not yet tried v3.3, but I could perhaps test it if you are on the same OS as I am. I actually downloaded it a couple days ago and hope to get to playing around with it soon. And, hopefully I or someone else can help you depending on your OS setup, etc. m.

Mark said...

Hi Mike,

I installed SQuirreL 3.3.0 just the way you described it on my 64-bit Windows 7 PC. Although I did not get any errors at the end of the installation, and it said Squirrel has been installed successfully, I cannot open the application. Neither the desktop shortcut nor dblclicking on the batch file works :-\

Any idea how I could fix this?

Mike Eberhart said...

Mark,
I guess I need to check out the latest version and see what happens. I may have time this weekend.

But, I found this bug-posting on their site that may be helpful, if the issue/fix are the same for you.

See here: Neither Shortcut nor .bat will start Squirrel 3.3. That is what I would try first.

To summarize what the person making that post is saying, it sounds like you need to edit the C:\Program Files (x86)\squirrel-sql-3.3.0>squirrel-sql.bat file and do the following...

chop out the section that looks like this:
if exist "%IZPACK_JAVA%\bin\javaw.exe" (
set LOCAL_JAVA=%IZPACK_JAVA%\bin\javaw.exe
echo LOCAL_JAVA=%LOCAL_JAVA%
) else (
set LOCAL_JAVA=javaw.exe
)

and replace with just the following line:
set LOCAL_JAVA=%IZPACK_JAVA%\bin\javaw.exe

Mark, if you can try that and post back here whether it works or not, that'd be great! I may not get to this as quickly as you'd like otherwise due to time constraints. Thanks. m

Anonymous said...

The solution I found (buried a couple links deep in your suggested reading).
e.g. https://sourceforge.net/mailarchive/message.php?msg_id=28606773

You need to double quote the following line, found at the top of the file:

set IZPACK_JAVA="%JAVA_HOME%"

Worked for me. Hopefully for you as well.

Anonymous said...

Was running into the below error from the command prompt under administrator:

C:\Users\Public\Documents\squirrel>java -jar squirrel-sql-3.4.0-install.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/izforge/i
zpack/installer/Installer (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)


Tried setting Environment variables to point to my current JAVA installation which had a build of 1.6
Noticed when I typed "java -version" that it was pointing to another JAVA installation build of 1.3.1.

So, I just enterered the full path to the JAVA installation with the correct version and program installed without error.

C:\Users\Public\Documents\squirrel>"c:\Program Files (x86)\Java\jre6\bin\java.exe" -jar squirrel-sql-2.6.9-install.jar

Steve Liu said...

Thanks for this post. It helped me install SquirrelSQL properly.

However, when I try to run it, it gets stuck on the "loading plugin" screen

Mike Eberhart said...

Steve,
Sorry, I have not played with Squirrel-SQL in a while, so I don't have any suggestion for getting past the loading-plugins hangup you are experiencing. I have not seen that. What version are you using (of Squirrel)? I can perhaps try to duplicate the bug and see what happens.

Anonymous said...

Thank you!!! Without this blog post I would have simply given up.

Anonymous said...

after trying all these different solutions, the program pops up a cmd window which closes in the blink of an eye. i am running java v7 and win 7 (x86). any help would be greatly appreciated, thank you.

Mike Eberhart said...

Anonymous (2013-09-19),
I have not tried this on 32-bit Windows, which I presume is what you mean by "win 7 (x86)". As the title of my blog suggests, I have only tried on x64 (64 bit windows). I actually do not have any machines that are not running x64. I hope someone else can offer insight where I cannot. If I misunderstood your configuration, let me know, and maybe I will be able to help if I have a similar config. regards. m

zhujrai said...

If u have problem with informix, install JDBC.3.70.JC8, then copy all files of C:\Program Files\IBM\Informix_JDBC_Driver\lib to the lib informix folder.

Anonymous said...

Thanks!! Helped me resolve the installation issue.

Anonymous said...

Thanks so much! Ran smoothly after I tried it your way.