▶️ https://www.youtube.com/watch?v=FKqruAJAJFw
Visit https://protector4j.com/download to download the latest version.
No special installation steps are required, just download and extract the archive.
Download the dmg file and drag Protector4J to Applications, the actual contents of this tool are in Protector4J.app/Contents/protector4j-mac
Go to the folder of Protector4J then execute p4j-ui[.exe] , you will see the interface below
For macOS, please just double click the Protector4J.app
If you have got the license, please click the login button on the top-right corner and input your account information. Although you can still try this tool free without the license.
Click the “Spring Boot Application” button on the app type page.
Choose the Spring Boot Jar File to protect, only one file can be selected here.
If this option is selected, only the encrypted jar files will be generated and the Java runtime will not be deployed, this option is usually used in combination with key seed for updating existing applications
Create the executable file to launch the application here.
This option is only valid for windows, applicable to gui applications
Set the arguments to be passed to the JVM here, such as -Xmx and -Xms, separated by spaces or newlines
Select the target Java version, support Java 8, Java 11 and Java 17
Selected by default, the task will create a folder like p4j-
Check this option, if this is a JavaFX Application
Check this option if this is a SWT gui application
Every encryption task will request a random key from the server by default, so the jar files generated in different encryption tasks can’t be used together. However, the same key seed will generate the same key, this option can used in combination with “Only Encrypt Jar Files” to update existing applications. And This option is only valid for Licensed user.
It will take some time to finish the encryption process. After it is done, you can check the result in the output folder.
Just run the executable file or the script created in the encryption task
If the application is for macOS or Linux and is generated under Windows,
please execute add-executable-permission.sh first to give the program executable permission.
If you need to modify the jvm options, edit the exe-name.json, there is an array called JArgs, you can edit and add the JVM options here.
1 | "JArgs" : [ |
It needs to specify a task file as an argument to the command-line tool.
Find spring-boot-task.yml
in task-templates
folder, copy and modify a new one.
1 | # Available values: 8,11,17 |
Go to the folder of Protector4J and execute the command below to run the encryption task
On Linux or macOS
For macOS users, you can find the cli tool in Protector4J.app/Contents/protector4j-mac
1 | ./p4j -t spring-boot -f path-of-task-file |
On Windows
1 | p4j -t spring-boot -f path-of-task-file |
-t task type
-f task file
You can execute p4j --help
to see the detail arguments.
Run with account information
1 | ./p4j -t spring-boot -f path-of-task-file -u email -p password |
After the encryption task, please go to the output folder to check the result.
Just run the executable file created in the encryption task
If the application is for macOS or Linux and is generated under Windows,
please execute add-executable-permission.sh first to give the program executable permission.
If you need to modify the jvm options, edit the exe-name.json, there is an array called JArgs, you can edit and add the JVM options here.
1 | "JArgs" : [ |