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

Merged
merged 7 commits into from
Aug 8, 2025

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

"Generic"

  • Consistency in formatting: Ensure consistent use of formatting for notes, for example, sometimes notes are enclosed in [NOTE] and sometimes not.
  • Check for consistent terminology: Ensure terms like "JetBrains Runtime" and "HotswapAgent" are consistently capitalized and referred to in the same manner throughout.
  • Clarify the statement under "Enabling Hotswap Manually": It would be helpful to mention if there are specific IDE settings or prerequisites that need to be checked or adjusted before starting the described process.
  • The term "hotswap" should be consistently hyphenated as "hot-swap" throughout the document.
  • In "Example Command", clarify whether specific version numbers or additional options might need to be specified for -XX.

"Visual Studio Code"

  • The "IMPORTANT" note about Copilot button availability references a link labeled <<../build#,production mode>> which may not render properly. Ensure this is correctly hyperlinked or explained.
  • Ensure consistent terminology: in "Enabling Hotswap Using Vaadin Copilot," make sure "Copilot" is consistently capitalized when referring to the UI element.
  • Clarify the use of "Development workflow": It would be useful to explain what "Development workflow" entails and why it is important in this context.

@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.

@peholmst peholmst merged commit 773841f into v24 Aug 8, 2025
1 check passed
@peholmst peholmst deleted the improve-vscode-hotswap-instructions branch August 8, 2025 06:35
vaadin-bot pushed a commit that referenced this pull request Aug 8, 2025
* Explain how to install JBR manually

* Move manual hotswap instructions to generic guide
peholmst added a commit that referenced this pull request Aug 8, 2025
* Explain how to install JBR manually

* Move manual hotswap instructions to generic guide

Co-authored-by: Petter Holmström <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked-main target/main cherry pick to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants