16

Resolving javaw.exe is not recognized With Squirrel SQL Client

I recently downloaded and installed SQuirreL SQL Client 3.5.0. The client would not launch through the shortcut created by the installer. A command prompt window would flash briefly. I tried running squirrel-sql.bat through command prompt and was receiving the error:

C:\Program Files (x86)\squirrel-sql-3.5.0>squirrel-sql.bat

Using java: javaw.exe
"javaw.exe" is not recognized as an internal or external command, operable program or batch file.

For me, the .bat file is located in C:\Program Files (x86)\squirrel-sql-3.5.0.

The heading looks like:

@echo off

@rem IZPACK_JAVA is filtered in by the IzPack installer when this script is installed
set IZPACK_JAVA="%JAVA_HOME%"

@rem We detect the java executable to use according to the following algorithm:
@rem
@rem 1. If the one used by the IzPack installer is available then use that; otherwise
@rem 2. Use the java that is in the command path.
@rem 
 
if exist "%IZPACK_JAVA%\bin\javaw.exe" (
  set LOCAL_JAVA=%IZPACK_JAVA%\bin\javaw.exe
) else (
  set LOCAL_JAVA=javaw.exe
)
 
echo Using java: %LOCAL_JAVA%

It appears that JAVA_HOME can’t be found. I removed the logic and explicitly defined the path to LOCAL_JAVA.

@echo off
 
set LOCAL_JAVA=C:\Program Files (x86)\Java\jre7\bin\javaw.exe
 
echo Using java: %LOCAL_JAVA%

The client then launched successfully. When reverting back to the original .bat, it appears that the squirre-sql.sh file also updates itself to reflect the change, and the client continues to launched successfully.

Norbert Krupa

Technical Consultant

16 Comments

  1. Holy crap, it worked!!! This REALLY helped me. Thanks so much for posting.

  2. After wasting an hour dealing with this BS… your post resolved my problem. THANK YOU! Now let’s see if this SQuirreL is any better than SQL Workbench.

  3. Another tip is just set the java home folder to IZPACK_JAVA

    Like : set IZPACK_JAVA=C:\Program Files (x86)\Java\jdk1.8.0_31 Instead of [“%JAVA_HOME%”]
    Make sure double quote not present beside the java home

  4. OMG…thank you so much! I have been trying to fix this over 4 hours. I can now go to sleep!

Leave a Reply

Your email address will not be published. Required fields are marked *