GUI User Guide
The GUI completes protection tasks via a wizard process, as follows:
Application type → Input/Runtime/Platform → Simple or Advanced parameters → Output confirmation → Execute
1. Application Type
| GUI Options | Input | Output | Corresponding CLI |
|---|---|---|---|
| Java Application | Regular executable JAR | Full application directory | javaapp |
| Spring Boot | Spring Boot application | Full application directory | springboot |
| Tomcat WAR | WAR | Embedded Tomcat directory | tomcat |
| Library Encryption | Any JAR | Single P4JX archive | encode |
Choosing the wrong type may prevent the main class, dependencies, web resources, or launcher from being processed correctly.

2. Input, runtime, and target platform
Select an input JAR or WAR for a single wizard task. Then select:
- Bundled Java version: 8, 11, 17, 21, or 25, with 21 as the default.
- Target platforms: Multiple platforms can be selected at once.
- Mode: Simple mode or advanced mode.
When multiple platforms are selected, the tool generates a separate directory for each platform.

3. Simple mode
Simple mode is suitable for the vast majority of first-time packaging tasks. When leaving the input page, the tool automatically performs a compatibility scan and selects based on the results:
- Classes recommended for exclusion;
- Whether to enable JavaFX and WebView;
- Whether to enable the scanner ZIP overlay;
- Whether to switch to the
.jarsuffix; - The recommended layout for Spring Boot;
- Tomcat 9 or 10.1.
The scan results are suggestions from static analysis, not complete runtime tests. Application testing should still be conducted on the target platform after packaging.
4. Advanced mode
In advanced mode, users can manually configure the archive suffix, decide whether to disable JIT, add a scanner overlay layer, set JVM parameters, define exclusion rules, and specify options for different application types.
For complete instructions, parameter meanings, default values, and differences among application types, refer to Protector4J Advanced Mode Settings.

5. Exclusion rules
The same rules apply to both GUI and CLI:
com.example.SecretService Exact class name
com.example.service.* Only the current package
com.example.service.** Current package and all sub-packages
It is recommended to exclude DTOs, entities, Controllers, configuration classes, JNI bridge classes, and classes that require runtime bytecode enhancement, so as to provide protection only for core business logic.
6. Output confirmation
Display on the last page:
- Input and application type;
- Java version and target platform;
- JavaFX status;
- Archive format, JIT, overlay, and Spring layout;
- Protection scope, exclusion rules, and Tomcat context.
You can select Create new folder to create a unique p4jx-xxxx subdirectory in the output directory. This option cannot be enabled when adding applications to Tomcat, as the existing Tomcat package directory must be specified directly.

7. Export and load task files
The advanced parameters page and the final confirmation page can be exported:
p4j-encrypt-run.shp4j-encrypt-run.bat
The script calls the installed p4j command and saves the currently parsed options. Account email and password are not written to the file.
Use Load Task File at the top of the window to reload the script and resume the task, then proceed directly to the final confirmation page. When an older script lacks task metadata, the GUI will attempt to parse the p4j command within it.