JRebel for Cloud in Visual Studio Code

This section lists the steps required to set up JRebel for Cloud on Visual Studio Code. You must have an activated JRebel installation in your IDE. For more information, see how to install and configure JRebel for Visual Studio Code.


1. Enable JRebel remote server support on the server

Running JRebel on a remote server requires the JRebel agent and a launch parameter. Follow the instructions:

  1. Download the standalone JRebel archive and extract its contents. Upload the contents to the remote server.

  2. Add -agentpath:[/path/to/]JRebel library attribute to the server startup parameters. Select the correct JRebel library based on the remote server operating system and architecture (see Launch from Command Line). This ensures that JRebel is started with the server.

  3. Add the -Drebel.remoting_plugin=true attribute to the server startup parameters.

Following is an example of a server startup script with both JRebel (Windows 64-bit) and remote server feature enabled:

-agentpath:[/path/to/]libjrebel64.dll -Drebel.remoting_plugin=true

Enabling password authentication

To enable JRebel password authentication on the server, use the -set-remote-password <NewPassword> CLI command. Ensure that all connecting JRebel IDE plugins are configured with the same password for successful synchronization.

Note

Use the following parameter to remove the password from the server: java -jar jrebel.jar -disable-remote-password


How do I know this works?

Once you have successfully configured JRebel remote server support for your remote server, you should see the following banner during remote server startup:

2024-04-02 14:23:55 JRebel:  #############################################################
2024-04-02 14:23:55 JRebel:
2024-04-02 14:23:55 JRebel:  JRebel Agent 2024.1.0 (202001051049)
2024-04-02 14:23:55 JRebel:  (c) Copyright 2007-2024 Perforce Software, Inc.
2024-04-02 14:23:55 JRebel:
2024-04-02 14:23:55 JRebel:  JRebel started in remote server mode.
2024-04-02 14:23:55 JRebel:
2024-04-02 14:23:55 JRebel:  #############################################################

2. Add a remote server to Visual Studio Code

Adding a remote server enables the JRebel IDE plugin to communicate with the JRebel agent running on the server, allowing your changes to sync over the network to the remote server. To add a remote server:

  1. Go to JRebel > Workspace Settings > Remote Server.

    ../_images/vscode-remoteserver.png
  2. Click Add Server.

    ../_images/vscode-remoteserver-addserver.png

Provide the following information:

  • Server Name – Provide a name for the remote server.

  • Server URL – Provide the full URL for the server.

To enforce server security, provide the authentication under Security Settings using:

  • Server Authentication – Enable additional synchronization security. Specify a simple alphanumeric password. The password also needs to be set on the server by using the command: java -jar jrebel.jar -set-remote-password <NewPassword>

  • HTTP Basic Authentication – Enable HTTP authentication for a remote server by providing username and password.

  1. Click Test Connection to test the server URL. This test will ping the server for JRebel, verifying the correct version.

  2. Click Save.

This server can be used by all projects in Visual Studio Code. Multiple remote servers can be added and used simultaneously. To automatically synchronize changes with remote servers when compiling, select Synchronize on build under JRebel > Workspace Settings > Remote Server.

3.Configure projects for remote server support

  1. Go to JRebel jicon > Home > Project Panel or JRebel jicon > Go to Projects.

    ../_images/vscode-enableremoteserver-jrebel.png
  2. Select the checkbox for your project. The configuration file rebel-remote.xml is created in the project resources folder.

  3. Build and redeploy your application containing the rebel-remote.xml configuration file to the remote server.

4. Synchronize with the server

Click the jrcloudicon synchronization checkbox against a project to manually synchronize your workstation and remote servers. To synchronize all projects between your workstation and a remote server, go to Explorer > Java Projects and then click the jrcloudicon icon.

You can also right-click the desired project node in the project explorer to synchronize an individual project. Go to Explorer > Java Projects and right-click the desired project node and then select JRebel > Synchronize with remote server.

../_images/vscode-remoteserver-sync.png