Throughout this course, you’ll use a local Liferay environment to implement Clarity’s apps. Here you’ll prepare your system and set up the Clarity workspace you’ll use in course exercises.
Ensure your system satisfies the following prerequisites:
-
Git
-
Java JDK 21
-
Liferay CLI Tools
To verify Git is installed and ready for use, open a terminal window and run this command:
If you’re on Windows, use Command Prompt, PowerShell, or BASH to execute terminal commands.
This returns the version of your git installation. For example,
If the Git command is not found, please see official documentation for how to install Git for your OS (macOS|Windows|Linux/Unix).
This course requires Java JDK 21. You can find the appropriate OpenJDK distribution for your OS here. You can download the JDK as a ZIP (Windows) or TAR.GZ (Linux/Mac) package. To install, extract the file in a folder of your choice, then set the JAVA_HOME environment variable to that folder. Alternatively, you can install Java using native installers according to your OS (macOS|Windows|Linux).
Once you’ve installed Java JDK 21, open a terminal window and run this command to ensure it is ready for use:
The JDK version appears. For example,
If it does not, you may need to perform additional troubleshooting steps that are beyond the scope of this course. Please see the relevant Java JDK installation documentation for your system.
Liferay provides two command-line tools (Blade CLI and Liferay Cloud CLI) to empower users to perform essential lifecycle operations without the need of a graphical user interface. For this course, they are optional. Though if you’re working with Liferay SaaS and plan to create client extensions, the Liferay Cloud CLI tool is necessary.
The Blade CLI tool can simplify many development tasks. You can use it to create new workspaces, get server bundles, spin up Liferay instances, and more. See Blade CLI installation instructions.
Once finished, run this command to verify Blade is installed and ready to use:
It should return the CLI’s version:
blade version 7.0.1.202407261807
If the output indicates there is a newer version, run this command to update it:
While we recommend using Blade to set up Liferay Workspace, you can also use Gradle to complete the process manually. See Creating a Liferay Workspace Manually for more information.
The Liferay Cloud CLI tool is for managing instances without using the Liferay Cloud Console UI. This versatile tool provides support for almost all management functions, though its primary uses are
Using the Cloud CLI tool, you can do all this with just a few commands, which are tasks that would otherwise require navigating around the Cloud Administrator Console. To use it, you’ll have to log in when it first runs and set the URL for your Liferay environments, but after that you’re ready to go.
If you’re on Liferay PaaS, this tool is not required for deployment, but it is highly recommended. If you’re on Liferay SaaS, it is required for deploying client extensions. Please see Liferay Cloud Command-Line Tool for installation instructions.
Great! With the prerequisites in place, let’s explore Liferay Workspaces and set up your Liferay environment.
As explained in the previous module, you’ll help implement Clarity’s app throughout this course. Instead of starting from scratch, you’ll use a partially complete app provided in a Liferay workspace: liferay-course-objects. Here you’ll set up this workspace locally in preparation for the following modules.
To do this,
-
Open your terminal and clone the training workspace to your computer:
If you’ve cloned the repo previously, ensure your workspace is up to date by running git pull origin main
.
-
Go to the workspace’s root folder in your terminal:
-
Initialize your Liferay bundle.
This downloads and builds dependencies for running Liferay, including the Liferay Tomcat server.
If you don’t have Blade installed, run the correct gradlew command for your OS:
Unix-based:
Windows:
This sample workspace includes a hotfix, which you'll need to install before starting your server.
-
Go to the patching tool folder.
-
Install the hotfix using the correct command for your OS.
Unix-based:
Windows:
-
Verify that the hotfix has been successfully installed.
If you've started your Liferay server previously, go to the bundles/osgi/state
folder and remove its contents.
-
Use Blade to start your Liferay server:
Alternatively,
Unix-based:
Windows:
You may notice some errors during your initial startup (e.g., reindexing). You can safely ignore these errors.
-
When finished, access your Liferay DXP instance by going to localhost:8080 in your browser.
-
Sign in using these credentials:
-
Take some time to explore the site and resources included in the training workspace.
Great! With your environment set up, you’re ready to start contributing to Clarity’s apps. Next, you’ll start learning the fundamentals of Liferay Objects.