header-id |
---|
installing-blade-cli |
[TOC levels=1-4]
You can install Blade CLI using the Liferay Project SDK installer. This installs JPM and Blade CLI into your user home folder and optionally initializes a Liferay Workspace folder.
| Note: In the past, if you've installed Blade CLI globally (e.g., using
| sudo
), you should not run the installer to update your Blade CLI version.
| Since the installer only installs Blade CLI to your user home folder, your
| previous global installation would always override the installer's installation.
| Therefore, always follow the
| Updating Blade CLI
| tutorial to update your Blade CLI instance.
If you need to configure proxy settings for Blade CLI, follow the Installing Blade CLI with Proxy Requirements
Follow the steps below to download and install Blade CLI:
-
Download the latest Liferay Project SDK installer that corresponds with your operating system (e.g., Windows, MacOS, or Linux). The Project SDK installer is listed under Liferay IDE, so the folder versions are based on IDE releases. You can select an installer that does not include @ide@, if you don't intend to use it. The Project SDK installer is available for versions 3.2.0+. Do not select the large green download button; this downloads Liferay Portal instead.
-
Run the installer. Click Next to step through the installer's introduction.
-
If you'd like to initialize a Liferay Workspace, you can set the directory where it should go.
Select the Don't initialize Liferay Workspace directory option if you only want to install Blade CLI. Then click Next.
-
If you decided to initialize a Liferay Workspace folder in the previous step, you'll have an additional option to select the Liferay product type you'll use with your workspace. Choose the product type and click Next.
-
Click Next to begin installing Blade CLI/Liferay Workspace on your computer.
That's it! Blade CLI is installed on your machine! If you specified a location to initialize a Liferay Workspace folder, that is also available.
Blade CLI offers many
create
templates
to help build @product-ver@ applications. It also offers various ways to deploy
those apps and interact with your Liferay server. Be sure to explore more Blade
CLI tutorials to learn how.
If you're using macOS or Linux, you could experience an issue where the blade
command is not available via command line. This is caused by the installer being
unable to add JPM's bin
folder to your user path. JPM is a Java package
manager used in Blade CLI.
To add the required bin
folder, execute the appropriate command based on your
operating system.
macOS:
echo 'export PATH="$PATH:$HOME/Library/PackageManager/bin"' >> ~/.bash_profile
Linux:
echo 'export PATH="$PATH:$HOME/jpm/bin"' >> ~/.bash_profile
Once you restart the command line, the blade
command should be available.