squirrel-sql-client / squirrel-sql-code

Share of the SQuirreL SQL source code originating from SourceForge, see https://squirrelsql.org
GNU Lesser General Public License v2.1
59 stars 11 forks source link

Installation issue - Java version checking #7

Open rodj59 opened 1 year ago

rodj59 commented 1 year ago

Starting SQirreL would not work with just the JRE installed, even though this includes the JVM.

Firstly I tried installing with the latest JRE already installed. It failed. I then modified the .bat file to change the version numbers to one the included the 1.8 version I had. It still failed. The only way I could see to get it to work was to install the JDK (version 19) and change the .bat file back to checking the JDK version.. i.e. It is requiring users to have the JDK installed and not working with a JRE.

gerdwagner commented 1 year ago

Since Version 4.3.0 SQuirreL requires at least Java 11. So if you don't use a rather outdated version Java 1.8 won't work.

Sorry, I wasn't able to reproduce your other JRE/JDK issues. In case you are looking for latest JDKs free an open source, see https://adoptium.net

rodj59 commented 1 year ago

I had the very latest JRE installed jre-8u351-windows-x64.exe.. i.e version 8 update 351 (file version 1.8.0.3510.10) build 1.8_351-b10. The JDK I ended up installing (which I was able to get it to work with) was JDK 19. Basically it would appear the assumption is that the user has a fully fledged Java Development Kit installed before being able to use the SQirreL client, whereas, it is my understanding, the idea is that the 'ordinary' user who would more likely just have the JRE installed should be able to use it. I apologize, in advance, if that is not the case, or I have failed in my limited knowledge of the ins and outs of the Java environment.

Kyogre commented 1 year ago

Hi! I solved the problem of java version checking this way:

  1. Install official java version 8 (at the moment of writing this comment the installer jre-8u351-windows-x64.exe is available at https://www.java.com/en/download/)

  2. Download and unpack any new required java version from https://jdk.java.net/archive/ (I have chosen java 16 openjdk-16.0.2_windows-x64_bin.zip)

  3. Open "squirrel-sql.bat" with any text editor -> locate the line set "IZPACK_JAVA=%JAVA_HOME%" -> above that line add the line set path="C:\...\jdk-16.0.2\bin";%path% (ofcourse the path between the quotes will be different for your chosen java version and its location). This line allows system to forward the path to java specifically for SQuirreL SQL without affecting the rest applications. Now the beginning of .bat file will look like this

    @echo off

    set path="C:\some_path\jdk-16.0.2\bin";%path% set "IZPACK_JAVA=%JAVA_HOME%"

  4. Save the changes. Now you can launch SQuirreL SQL via .bat file (or a shortcut to the .bat file) as usual.