This is cjx cli. It can be used to setup your JavaFX development environment using VS Code as your IDE.
- Java 11 or higher
- VS Code
- VS Code Java Extension Pack
- JavaFX SDK
- Git
- Scene Builder Extenstion for VS Code
- After downloading the JavaFX SDK, extract the zip file in a place where you can easily access (
C:/
is recommended) - Remember the path of the extracted folder, you will need it later
- Download the latest release from here
- Download the zip file in the assets section
- Extract the zip file
- Open the cjx folder inside the extracted folder
- Open terminal (
command prompt is recommended
) inside thecjx
folder and typecjx init
to initialize your CJX CLI. You should see the following output:CJX CLI initialized successfully
CJX CLI path successfully set to <Your current directory>
CJX CLI added to the environment variables successfully
- Open a new terminal and type
cjx
to check if it is installed correctly. If it is installed correctly, you should see the following output:CJX CLI
and other paragraph that explains how to use the CLI. - You can type
cjx -h
to see all the commands available. - Now you can use cjx to setup your JavaFX development environment
- Open terminal from any directory you want.
- type
cjx setup <JavaSDK Dirercory>
- The JavaFX SDK directory is the path of the extracted JavaFX SDK folder you downloaded earlier. You should see the following output:
JavaFX SDK path set successfully to <JavaFX SDK Directory>
- Now you can use cjx to create a new JavaFX project
- Run
cjx doctor
to check if everything is setup correctly - If there is any error, go back and check if you have done everything correctly
This command initializes the CJX CLI. You should run this command only once inside the cjx folder.
This command sets the path of the CJX CLI. You should run this command only once inside the cjx folder.
This command sets the path of the JavaFX SDK. You should run this command only once.
This command creates a new JavaFX project. You can use this command to create a new JavaFX project.
cjx create simple <Project Name>
cjx create jfxml <Project Name>
This command clones a JavaFX project from a git repository and set it up for offline development in your local machine and configures all the needed settings for VS Code.
This command checks if everything is setup correctly. You can use this command to check if everything is setup correctly.
- Open the cjxupdate folder inside the zip file you downloaded
- Open command prompt inside the cjxupdate folder
- Type
cjxupdate -c
to check for updates - If there is an update, you will see the following output:
A new version is available
- Type
cjxupdate -u
to update the CJX CLI - You can check the version of the CJX CLI by typing
cjx -v
after the update is complete
Caution: If you are currently using v2.2 or less, you should update to v3.0 manually by downloading v3.0 from the releases page.
If you face this problem when trying to run the command cjx init
inside the folder you extracted the cjx zip file. Try to add the path of the cjx folder to your PATH environment variable. You can follow this tutorial to add the path to your PATH environment variable.
If you face this problem when trying to run the command cjx create simple <Project Name>
or cjx create jfxml <Project Name>
. Try to run the command cjx setup <JavaFX SDK Directory>
to set the path of the JavaFX SDK. You can find the JavaFX SDK directory in the Prerequisites section.