SQL Workbench/J requires a Java 8 (or higher) runtime environment. You can either use a JRE ("Runtime") or a JDK ("Development Kit").
Build 126 is the last version to support Java 8, following versions will require Java 11 or higher.
For Windows® and Linux a batch file is provided to automatically download a Java runtime environment
It will download the most recent JRE from AdoptOpenJDK, unpack
the archive and store it in a sub-directory named
jre which will automatically be used
by the native Windows® launcher and the Linux shell scripts to start SQL Workbench/J
You can manually download Windows®, Linux or MacOS binaries from one of these sites:
Starting with build 126 the Windows launcher can also download a Java runtime, if none was found.
Once you have downloaded the application's distribution package, unzip the archive into a directory of your choice. Apart from that, no special installation procedure is needed.
You will need to configure the necessary JDBC driver(s) for your database before you can connect to a database. Please refer to the chapter JDBC Drivers for details on how to make the JDBC driver available to SQL Workbench/J
When starting SQL Workbench/J for the first time, it will create a directory
.sqlworkbench in the current user's home folder to
store all its configuration information.
The "user's home directory" is
$HOME on a Linux or Unix based system,
%HOMEPATH% on a Windows® system. (Technically speaking
it is using the contents of Java system property
find the user's home directory).
When upgrading to a newer version of SQL Workbench/J simply overwrite the old
exe files and shell scripts that
start the application. If you are using the bundle that includes the libraries for
reading and writing OpenOffice and Microsoft Office files, replace all existing
ext subdirectory with those from the distribution archive as well.
To start the program a shell/batch script is provided.
When using Linux or MacOS SQL Workbench/J can be started using
When using Windows®, you can either use the batch file
SQLWorkbench.exe to start SQL Workbench/J.
Details on using the Windows® launcher can be found here.
To run SQL Workbench/J under an Unix-type operating system, the supplied shell script
sqlworkbench.sh can be used.
The shell scripts (and the batch files) first check if a Java runtime is available in the sub-directory
If that is available it will be used. The shell script
download_jre.sh will automatically extract
the Java runtime into that directory.
If no "local" Java runtime is found, the environment variable
is checked. If that variable is defined and points to a Java runtime installation, the shell script will
$WORKBENCH_JDK/bin/java to run the application.
WORKBENCH_JDK is not defined, the shell script will check
for the environment variable
JAVA_HOME. If that is defined, the script
$JAVA_HOME/bin/java to run the application.
JAVA_HOME is defined,
the shell script will simply use
java to start the application,
assuming that a valid Java runtime is available on the path.
All parameters that are passed to the shell scripts are passed to the application, not to the Java runtime. If you want to change the memory or other system settings for the JVM, you need to edit the shell script.
To start SQL Workbench/J on the Windows® platform, the supplied
for a 32bit Java runtime or
SQLWorkbench64.exe for a 64bit Java runtime can be used to start the program.
sqlworkbench.jar has to be located in the same directory as the exe files, otherwise it does not work.
By default the launcher will initialize the Java runtime in the same process as long as the "bitness" of the used Java runtime
matches the one from the launcher. If
SQLWorkbench64.exe is used, but a 32bit Java runtime is configured,
the launcher will start Java as a second process. Likewise, if
SQLWorkbench.exe is used and a 64bit Java runtime is configured,
the launcher will also start Java as a second process.
Note that "pinning" SQL Workbench/J to the Windows® taskbar only works if the launcher can initialize the Java runtime as part of its own process and thus no second process is started.
SQL Workbench/J does not need a "fully installed" runtime environment, you can also copy
jre directory from an existing Java installation into the directory where SQL Workbench/J is installed.
Creating a symbolic link (using
mklink) also works. A "local" Java installation in the
jre subdirectory will have priority over any JRE or JDK registered
in the Windows® registry.
The launcher searches for the Java runtime in the following order. The first Java installation found will be used.
-javaHomewas specified. If it was provided and points to a Java installation, that will be used.
javaHomeentry. If it exists and points to a Java installation, that will be used.
WORKBENCH_JDKis defined, the launcher will use that to run the application.
JAVA_HOMEis defined, the launcher will use that to run the application.
PATHvariable are searched for a Java installation. The first one found will be used.
If neither of those steps found a Java runtime, the launcher offers to download a Java runtime or select an existing installation. The Java runtime is downloaded from AdoptOpenJDK, as the the provided batch file does.
When using a 32bit Java runtime the default memory available to the application is set to 1GB. When using a 64bit Java runtime the default is set to 65% of the available physical memory.
Additional parameters to the Windows® launcher can be defined in a configuration file that needs to be created
in the directory where
SQLWorkbench.exe is located. The name of the file has to be
The format of
If the launcher cannot find a Java runtime, you can specify the location of the JRE in the configuration file
in the section
[Workbench] with the following parameter:
[Workbench] javaHome=c:\Program Files\Java
You need to specify the root directory of the Java runtime (or JDK). This can either be a 32bit or a 64bit runtime,
but a 64bit runtime is highly recommended (and therefor using
The memory available to the Java runtime is specified through the configuration file by providing the corresponding
JVM paramter. The following entry would set the maximum memory to 4GB (the
-Xmx part is passed
to the Java runtime)
You can verify the available memory in the about dialog:→
The configuration directory is the directory where all config (
WbDrivers.xml) files are stored.
If no configuration directory has been specified on the commandline, SQL Workbench/J will identify the configuration directory by looking at the following places
$HOME/.sqlworkbenchon Unix based systems or
%HOMEPATH%\.sqlworkbenchon Windows® systems)
If the file
workbench.settings is found in one of those directories, that
directory is considered the configuration directory.
If no configuration directory can be identified, it will be created in the user's home directory (as
The above mentioned search can be overridden by supplying the configuration directory on the commandline when starting the application.
The following files are stored in the configuration directory:
WbShortcuts.xml). If you did not customize any of the shortcuts, this file does not exist
If you want to use a different file for the connection profile than WbProfiles.xml then you can specify the
location of the profiles with the
-profileStorage parameter on the command line.
Thus you can create different shortcuts on your desktop pointing to different sets of profiles.
The different shortcuts can still use the same main configuration file.
|The location of the settings file (and therefor the configuration directory) is shown through→ and on the "General" page of the Options dialog which can be displayed using → .|
To copy an installation to a different computer, simply copy all the files from the configuration directory
to the other computer (the log file does not need to be copied).
When a profile is connected to a workspace, the workspace file should be specified
without a directory name (or using the
In that case it is always loaded from the configuration directory.
If the workspace file is given with an absolute directory, this needs to be adjusted
after the copying the files.
You will need to edit the driver definitions (stored in
because the full path to the driver's jar file(s) is stored in the file.
If you store all JDBC drivers in a common directory (or below a common root directory)
you can define the libdir variable. In that case the paths to the
driver's jar file are stored relative to the
After copying the installation you only need to adjust the
on the other computer.
SQL Workbench/J is a Java application and thus runs inside a virtual machine (JVM). The virtual machine limits the memory of the application independently from the installed memory that is available to the operating system.
SQL Workbench/J reads all the data that is returned by a SQL statement into memory. When retrieving large result sets, you might get an error message, indicating that not enough memory is available. In this case you need to increase the memory that the JVM requests from the operating system (or change your statement to return fewer rows).
When using the Windows® launcher (e.g.
SQLWorkbench64.exe), the available memory is defined
in the INI file.
When using the shell or batch scripts, the available memory is defined through the
parameter for the
java command. In the following example, the parameter
sets the available memory to 4GB
java -Xmx4g -jar sqlworkbench.jar
If you are using the supplied shell scripts to start SQL Workbench/J, you can edit the scripts and change the value for the -Xmx parameter in there.
|With a 32bit Java runtime, you can not use (or assign) more than approx. 1.5GB for the application. If you need to process results that require more memory that that, you will have to use a 64bit Java runtime.|