NetBeans RCP Quick Start
- Step 1: Add the Distribution to
applibs - Step 2: Add the NetBeans-Specific JVM Flags
- Step 3: Mount the Bridge in a View
- Step 4: Run the Application
- Next Steps
This page walks through the fastest path to a pre-built NetBeans Platform application rendering in the browser: drop the distribution into applibs/, add a few JVM flags, mount the bridge in a view, and run.
|
Note
|
Prerequisites
This page builds on a working SwingBridge project. If you don’t have one yet, set it up first with the SwingBridge Quick Start (skeleton starter) or Installation from Scratch. You also need a pre-built NetBeans Platform distribution and JDK 21 — see Prerequisites. |
Step 1: Add the Distribution to applibs
Copy your pre-built NetBeans Platform distribution directory into the project’s applibs directory. This is the same directory the platform’s own launcher would run; it has this shape:
Source code
filesystem
my-vaadin-app/
├── pom.xml
├── applibs/
│ └── my-rcp-app/ ← the pre-built NetBeans Platform distribution
│ ├── etc/
│ │ ├── my-rcp-app.clusters ← branding marker
│ │ └── my-rcp-app.conf ← (optional) defines --laf, JVM options
│ ├── platform/
│ │ └── lib/boot.jar
│ ├── my-rcp-app/ ← branding cluster (matches the .clusters name)
│ └── <feature clusters>/
└── src/...SwingBridge discovers the distribution through the standard convention ladder — the applibs/ directory, a directory entry in swing-app-jar-list.conf, or the -Dswingbridge.rcp.cluster.dir system property. See Cluster Discovery for the full resolution order.
|
Note
|
A directory qualifies as a distribution only when it contains both |
Step 2: Add the NetBeans-Specific JVM Flags
On top of the standard SwingBridge runtime flags, a NetBeans Platform guest needs a few more. Add them to the <jvmArguments> of the spring-boot-maven-plugin:
Source code
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.desktop/javax.swing=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.text=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/java.security=ALL-UNNAMED
-Djava.security.manager=allow--add-opens=java.base/java.lang=ALL-UNNAMED and -Djava.security.manager=allow are the load-bearing ones — without them the platform fails to boot. See NetBeans JVM Flags for the complete block and an explanation of each flag.
Step 3: Mount the Bridge in a View
Add a NetBeansRcpBridge to a Vaadin view. The no-arg constructor renders the whole platform shell:
Source code
Java
@Route("desktop")
public class DesktopView extends VerticalLayout {
public DesktopView() {
setSizeFull();
setPadding(false);
var rcp = new NetBeansRcpBridge();
rcp.setSizeFull();
add(rcp);
expand(rcp);
}
}That’s the whole integration — no path parameters, no source changes to the RCP project.
|
Note
|
As with any SwingBridge guest, server push must be enabled with the |
Step 4: Run the Application
Source code
terminal
./mvnw spring-boot:runterminal
terminal
terminal
Open the application in your browser and navigate to the view’s route (/desktop in the example above). The first session pays a one-time cold-start cost of a few seconds while the platform boots in-process; then the NetBeans main window paints into the canvas, and mouse, keyboard, menus, and dialogs all work as they do on the desktop.
|
Note
|
Cold start is roughly 5–8 seconds per session. If two browser sessions mount the bridge cold at the same time, their boots are serialized, so the second waits for the first. See Cold-Start Performance. |
Next Steps
-
Embed a single view instead of the whole shell, or drive Vaadin navigation from an RCP action: Embedding Modes.
-
Cluster discovery, the full JVM flag set, and system properties: Requirements and Configuration.
-
Per-session isolation, lifecycle, performance, and known limitations: Multi-Tenancy and Lifecycle.