-
Notifications
You must be signed in to change notification settings - Fork 209
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
base: latest
Are you sure you want to change the base?
Conversation
AI Language ReviewThe 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. |
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. |
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: |
There was a problem hiding this comment.
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:
- Open the Settings UI using Cmd+, (Mac) or Ctrl+, (Windows/Linux).
- 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.
@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? |
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 |
Answering my own question: I guess Maven does not do incremental builds. |
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. |
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. |
![]() Extension does everything. |
in response to https://vaadin.com/forum/t/need-more-information-on-vscode-install-runtime-and-hotswap/178020/1