Project

General

Profile

VS Code Setup

Introduction

This section describes how to install VS Code and set up the FWD project in it. It is assumed that the FWD trunk (or a custom branch) has been checked out in the ~/projects/fwd/trunk directory, and the customer application has been checked out in the ~/projects/fwd directory.

Install the IDE

The commands do not need to be executed inside the fbash.sh or dbash.sh script environments.

Via the official website installer

1. Download the installer from the official website, taking into account the operating system in use. For VS Code, the installer can be accessed at https://code.visualstudio.com/download.

2a. For Linux-based systems, the downloaded content consists of a .deb package. To proceed with the installation, run the command in a terminal:

sudo apt install ~/Downloads/code_1.119.0-1778006717_amd64.deb

Note that the path or the archive name might need to be adjusted.

When prompted to install the apt repository and signing key, choose Yes.

2b. In Windows, the download consists of an executable. Go to the location of the downloaded file, double-click the executable and follow the installation steps.

3. To open the IDE, run the following command in a terminal:

code

You can also type code in the search bar, and open VS Code from the suggested applications.

Via snap (Linux)

1. Open a terminal and run the following command:

sudo snap install --classic code

Usually, Linux-based installations come with snap preinstalled, but in case of an error, you can install and enable snap via:

sudo apt install snapd
sudo systemctl enable snad
sudo systemctl start snapd

2a. The first way of opening the IDE is to run its corresponding command in the terminal. In VS Code case, this would be:

code

2b. Another option is to search for the IDE icon in the OS search bar and open it from there, assuming it didn't already provide a desktop entry which can be double-clicked.

Configure the IDE

By default, VS Code doesn't have the required customizations to run a FWD project, so we will look to add or modify a few things.

Java Extension

It is mandatory to have a Java extension in order to run/debug a Java project. The optimal choice is an extension called Debugger for Java provided by Microsoft.

1a. Open the Extensions panel from the left-side vertical bar. In the search bar of the newly-opened panel, search for Debugger for Java. Once the extensions has been found, click on it, and then press Install.

1b. Alternatively, you can install the extension without opening the Extensions panel, by using the VS Code Quick Open menu (Ctrl+P), typing ext install vscjava.vscode-java-debug in the newly-opened bar, and pressing Enter to launch the installation.

Configure the FWD project

The FWD project can be configured in the IDE. This allows checking the Java sources, testing changes, debugging.

1. Open the project in VS Code.

1a. Via Open Folder... option.

From the IDE, click on File in the top left of the screen, then press Open Folder.... In the opened window, navigate to ~/projects/fwd and select the directory containing the customer application.

1b. Via the terminal with:

cd ~/projects/fwd
code <customer_application>

2. Create the required configurations.

If a .vscode directory does not exist in the project folder, create one by clicking New Folder... from the root of the project. The name of the folder should be .vscode. That way, the IDE will know to look in there for configurations related to dependencies or server launch.

Create a settings.json by right-clicking the .vscode folder, then selecting New File.... Refer to the following example of a settings.json:

{
    "java.jdt.ls.vmargs": "-Xmx32G -XX:+UseG1GC",
    "java.project.sourcePaths": [
        "src",
        "p2j/src" 
    ],
    "java.import.exclusions": [
        "**/p2j" 
    ],
    "java.project.referencedLibraries": {
        "include": ["deploy/lib/*.jar"],
        "exclude": ["deploy/lib/p2j.jar"]
    }
}

This tells the JVM to use a maximum of 16GB of heap, value that can be adjusted based on the needs. Also, in terms of sources, it tells the IDE to look into both the customer project sources (src) as well as the sources coming from the FWD project (p2j/src). Then, in terms of dependencies, it includes all the JARs present in deploy/lib, but exlcudes p2j.jar, because we've already linked the FWD sources.

Next up, create a launch.json by right-clicking the .vscode folder, then selecting New File.... This tells the IDE what settings to use when starting the server. Refer to the following example of a launch.json:

{
    "configurations": [
        {
            "type": "java",
            "name": "<application_name> Debug",
            "request": "launch",
            "mainClass": "com.goldencode.p2j.main.FwdLauncher",
            "args": [
                "server.xml",
                "net:connection:secure=true",
                "net:server:secure_port=3333",
                "net:server:insecure_port=3433", 
            ],
            "cwd": "${workspaceFolder}/deploy/server",
            "vmArgs": [
                "-ea",
                "-XX:StringTableSize=1000003",
                "-Xmx8192m",
                "-server",
                "-XX:+HeapDumpOnOutOfMemoryError",
                "-XX:GCTimeRatio=19",
                "-XX:MaxTenuringThreshold=7",
                "-Djava.locale.providers=SPI,CLDR,COMPAT",
                "--add-opens=java.base/java.lang=ALL-UNNAMED",
                "--add-opens=java.naming/javax.naming=ALL-UNNAMED",
                "--add-opens=java.base/java.net=ALL-UNNAMED" 
            ]
        }
    ]
}

Note: The sample launch.json has "request": "launch", which means that when launching the process, the IDE will start the FWD server, and not attach the process to an already running server. For more details on the later, check Debugging the Converted Application in Docker wiki.

3. Wait for the project to build.

If the project doesn't build automatically, you can go into the Command Pallete (Ctrl+Shift+P), type Reload Window, and press Enter. Alternatively, you can simply restart the IDE. This triggers a refresh of the IDE state.


© 2004-2026 Golden Code Development Corporation. ALL RIGHTS RESERVED.