Skip to content

Explain how to install JBR manually #4352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: latest
Choose a base branch
from

Conversation

peholmst
Copy link
Member

@peholmst peholmst commented May 30, 2025

@peholmst peholmst requested a review from MarcinVaadin May 30, 2025 08:50
Copy link

github-actions bot commented May 30, 2025

AI Language Review

The updated file "Visual Studio Code" does not contain significant changes that require correction or improvement. The document provides a clear, professional guide on running a Vaadin application using Visual Studio Code and enabling Java hotswap using Vaadin Copilot. The language is clear, and the instructions are suitable for a wide audience. The use of images and menus is correctly referenced and formatted.

@MarcinVaadin
Copy link
Member

Is this guide dedicated for Visual Studio Code or generic? If for VS Code then easiest option is to use Vaadin extension and it will do everything for user. If it is supposed to be generic tutorial, then we should remove VS Code references.

@peholmst
Copy link
Member Author

That's a good question. The forum was referring to the VS Code page, but the instructions are indeed generic. The Vaadin extension instructions are already listed on the page (at the top). I'll try to move the instructions to its own page.



=== Launch Configuration

Inside your Java project, create a new `.vscode/launch.json` file with the following contents:
Create a `.vscode/launch.json` file in the root of your Java project with the following contents:
Copy link
Member

@manolo manolo Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a new launch configuration file for each application can be a bit cumbersome for regular Vaadin developers.

To streamline the debugging experience, we should mention in the docs, that Hotswap Agent can be enabled globally by adding the following lines to the global settings.json file (note that path should refer the specific home of the JBR installed, this is mine):

"java.home": "/Library/Java/JavaVirtualMachines/jbrsdk-21.0.5-osx-x64-b631.16/Contents/Home/",
"java.debug.settings.vmArgs": "-XX:HotswapAgent=fatjar -XX:+AllowEnhancedClassRedefinition -XX:+UpdateClasses"

For opening the global settings.json file in the IDE:

  1. Open the Settings UI using Cmd+, (Mac) or Ctrl+, (Windows/Linux).
  2. Click the icon in the top right corner saying “Open Settings (JSON)” when hovered.

This ensures the Hotswap Agent is always enabled when launching or debugging Java applications in VS Code, without needing per-project launch configuration files.

@manolo
Copy link
Member

manolo commented Jun 2, 2025

If for VS Code then easiest option is to use Vaadin extension and it will do everything for user

@MarcinVaadin it seems that user still needs to install JBR and set manually this runtime as main one in their IDE, or the extension does?

@peholmst
Copy link
Member Author

peholmst commented Jun 2, 2025

I've been trying to create a generic instruction that only uses Maven and a text editor. As the classpath is huge, I've tried to use ./mvnw to start the application. I can see from the logs that hotswap agent is activated, but it does not detect when I recompile the project. Is this something that requires an IDE and special tool support?

@peholmst
Copy link
Member Author

peholmst commented Jun 2, 2025

Answering my own question: I guess Maven does not do incremental builds.

@peholmst
Copy link
Member Author

peholmst commented Jun 2, 2025

No, Maven seems to have some support for incremental builds. But HotswapAgent also needs to be notified that a class file has been changed. Need to check if there is any configuration flag for watching the file system.

@peholmst
Copy link
Member Author

peholmst commented Jun 2, 2025

Found the missing pieces. I have now created a generic guide that shows you how you can run the app with hotswap using the command line only.

@MarcinVaadin
Copy link
Member

@manolo

If for VS Code then easiest option is to use Vaadin extension and it will do everything for user

@MarcinVaadin it seems that user still needs to install JBR and set manually this runtime as main one in their IDE, or the extension does?

image

Extension does everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants