Installing Liquibase Command Line for Windows


Once you have downloaded the Liquibase-Version#-bin.zip file, right-click the zipped file and select Extract All. You can place the extracted folder anywhere on your local drive. Before configuring Liquibase, you must set a Path System Variable to the folder on your computer.

To set the Path System Variable:

  1. In your Windows search box, type env and select the Edit the System Environment option in the Control Panel.
  2. In the Advanced tab, select Environment Variables.
  3. In the System Variables section, highlight the Path variable and select Edit.
  4. In the Edit environment variable window, select New, then add the path to the Liquibase-Version#-bin folder.

Example: C:\apps\liquibase-3.8.1-bin

  1. Select Ok on all windows to close them.

Verifying

Verification is an essential aspect of the Liquibase installation process, and there are three things you need to check:

  1. The Liquibase folder was correctly added to your Path System Variables.
  2. Java is installed on your system.
  3. The Liquibase help command can be run in PowerShell.

Verification #1: Check Path System Variables

To verify that you have correctly added the Liquibase folder to your Path System Variables:

  1. In your Windows search box, type power and select Windows PowerShell.
  2. In the PowerShell window, type $env:PATH.

You should see the following:

Verification #2: Check for Java Installation

For Liquibase to run correctly, Java must be installed on your Windows machine. To verify that Java is installed on your computer:

  1. In your Windows search box, type cmd to open the Command Prompt.
  2. In the Command Prompt window, type java.exe -version. If you see the error message "'java' is not recognized as an internal or external command, operable program or batch file" or "java : The term 'java' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again", go to https://www.oracle.com/java/technologies/javase-downloads.html to install Java.

Verification #3: Run the Liquibase help Command

Another way to verify that you installed Liquibase correctly on your computer is to run the Liquibase help command. To run the command:

  1. In your search box, type cmd to open the Command Prompt.
  2. In the Command Prompt window, type liquibase --help.

Troubleshooting

  • If you cannot run the Liquibase help command, verify that you have correctly installed Java. Also, ensure that the Liquibase folder you downloaded is set to your Path System Variables.
  • If you have installed Java, but are still receiving an error, add Java to your Path System Variables using the steps provided in the following section.

How to set the JAVA_HOME environment variable

To set the JAVA_HOME environment variable, follow these steps:

  1. Locate your Java installation directory.
  2. In your Windows search box, type env and select the Edit the System Environment option in the Control Panel.
  3. In the Advanced tab, select Environment Variables.
  4. Under System Variables, select New.
  5. In the Variable Name field, enter either JAVA_HOME if you installed the JDK (Java Development Kit) or JRE_HOME if you installed the JRE (Java Runtime Environment). It should be your JDK or JRE installation path.

Example: C:\Program Files\liquibase\jdk1.8.0_65

  1. Select OK to apply changes.