Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion articles/flow/configuration/live-reload/hotswap-agent.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If you are using IntelliJ and the Vaadin plugin, you can launch your application

When running your application using *Debug using HotswapAgent*, the Vaadin plugin checks if you're using the proper JDK, if HotswapAgent is available, and applies additional required JVM arguments.

If you're using Eclipse IDE and the Vaadin plugin, right-click your application class and choose *Debug using Hotswap Agent*. The plugin brings its own copy of HotswapAgent and creates a debug configuration with the required JVM arguments, so the only thing you need to install is JetBrains Runtime. See <<{articles}/getting-started/dev-environment/run/eclipse#enabling-hotswap-using-the-vaadin-plugin,Run in Eclipse IDE>> for details.
If you're using Eclipse IDE and the Vaadin plugin, right-click your application class and choose *Debug using Hotswap Agent*. The plugin brings its own copy of HotswapAgent, offers to download JetBrains Runtime if you don't have one, and creates a debug configuration with the required JVM arguments. See <<{articles}/getting-started/dev-environment/run/eclipse#enabling-hotswap-using-the-vaadin-plugin,Run in Eclipse IDE>> for details.

If you're using VS Code and Vaadin Copilot, you can configure everything automatically from the Copilot Development Workflow guide. Follow the instruction to install the proper JDK, install the HotswapAgent library, and prepare the run configuration.

Expand Down
16 changes: 14 additions & 2 deletions articles/getting-started/dev-environment/run/eclipse.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,30 @@ Now click menu:Debug As[Java Application]. The application starts up and you can

== JetBrains Runtime

Whichever way you enable hotswap, the application has to run on JetBrains Runtime, because hotswap of Java classes needs the enhanced class redefinition that it provides. You can download the latest version from the https://github.com/JetBrains/JetBrainsRuntime/releases[JetBrains GitHub release page]. Be sure to select the correct architecture. Use JetBrains Runtime to execute your application, not necessarily your IDE.
Whichever way you enable hotswap, the application has to run on JetBrains Runtime, because hotswap of Java classes needs the enhanced class redefinition that it provides. Use JetBrains Runtime to execute your application, not necessarily your IDE.

If you use the Vaadin plugin, you don't have to install it yourself: the plugin offers to download a JetBrains Runtime when it can't find one, as described in the next section. For the manual setup, download the latest version from the https://github.com/JetBrains/JetBrainsRuntime/releases[JetBrains GitHub release page]. Be sure to select the correct architecture.


[[enabling-hotswap-using-the-vaadin-plugin]]
== Enabling Hotswap Using the Vaadin Plugin

The easiest way of running a Vaadin application with hotswap in Eclipse IDE is by installing the link:https://marketplace.eclipse.org/content/vaadin-tools[Vaadin plugin] from the Eclipse Marketplace. If you haven't done so already, do it now. Use the Eclipse IDE for Enterprise Java and Web Developers package. The same plugin also integrates Eclipse IDE with Vaadin Copilot, so that changes you make in the browser are written to your sources through the IDE.

The plugin bundles HotswapAgent and installs it for you as [filename]`.vaadin/eclipse-plugin/hotswap-agent.jar` in your home directory, so the only thing you have to install yourself is JetBrains Runtime. The plugin picks up any JetBrains Runtime that Eclipse IDE knows about. If it can't find one, add it on the menu:Java[Installed JREs] page in menu:Window[Preferences] (Windows) or menu:Eclipse[Preferences] (Mac).
The plugin bundles HotswapAgent and installs it for you as [filename]`.vaadin/eclipse-plugin/hotswap-agent.jar` in your home directory, and it takes care of JetBrains Runtime as well, so there's nothing else to install.

To start the application, right-click the main `Application` class in the project navigator and click menu:Debug As[Debug using Hotswap Agent]. If you can't see this option, the Vaadin plugin has not been installed correctly.

When you start the launch, the plugin looks through the JREs that Eclipse IDE knows about for a JetBrains Runtime that matches the Java version your project requires. If it doesn't find one, it opens a *JetBrains Runtime Required* dialog:

[guibutton]*Download JetBrains Runtime*::
Fetches the latest release for your operating system and processor architecture. The download is a few hundred megabytes, so it runs in a progress dialog that you can cancel. The runtime is installed as [filename]`.vaadin/jdk` in your home directory, the same location that the Vaadin plugins for IntelliJ IDEA and Visual Studio Code use, so it's downloaded only once per machine. It's also added to the menu:Java[Installed JREs] page, so that later launches reuse it. Should the newest JetBrains Runtime be older than your project requires, the plugin tells you instead of starting without it.

[guibutton]*Continue Without JBR*::
Starts the application on a regular JVM. Only changes to method bodies are hotswapped then; adding or removing methods and fields still requires a restart.

To use a JetBrains Runtime that you installed yourself, add it on the menu:Java[Installed JREs] page in menu:Window[Preferences] (Windows) or menu:Eclipse[Preferences] (Mac) before you start the launch. The plugin then uses that one and doesn't download anything.

The plugin creates a debug configuration named `Application [Hotswap]` that runs the application on JetBrains Runtime, starts the bundled HotswapAgent with a `-javaagent` parameter, and adds the other JVM parameters that hotswap needs. Because the agent comes from the plugin, you don't have to install it into JetBrains Runtime, and the parameters listed in <<debug-configuration,Debug Configuration>> are needed only for the manual setup. You can reuse the configuration later from the *Debug* button in the toolbar.

Once the application is running, continue with <<verifying-the-setup,Verifying the Setup>>. You don't need the manual steps described next.
Expand Down
Loading