Home >Java >How to add vmArgs for Fontawesmome library in VScode

How to add vmArgs for Fontawesmome library in VScode

王林
王林forward
2024-02-09 22:50:24986browse

php editor Banana brings you a guide on adding vmArgs to the Fontawesome library in VScode. Fontawesome library is a popular icon library, and by adding vmArgs to VScode, you can use these icons more conveniently during development. In this article, we'll detail how to set it up in VScode and provide a step-by-step guide. Whether you are a beginner or an experienced developer, this article will help you solve this problem easily and make your development work more efficient and convenient.

Question content

I am developing a javafx project using vscode and scene generator and adding icons using fontawesome-8.2.jar. When I try to run the code it gives me an error, if I remove the fontawesome icon it works fine. I think the problem is that I need to add fontawesome in the config but I don't know how.

This is my configuration:

{
    // use intellisense to learn about possible attributes.
    // hover to view descriptions of existing attributes.
    // for more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "cafeshopmanagmentsystem",
            "request": "launch",
            "mainclass": "cafeshopmanagmentsystem",
            "projectname": "cafeshopmanagementsystem_4876995e",
            "vmargs": "--module-path \"c:/java/lib\" --add-modules javafx.controls,javafx.fxml"
        },
        {
            "type": "java",
            "name": "current file",
            "request": "launch",
            "mainclass": "${file}"
        }
        
    ]
}

I tried adding fontawsome in the config as shown below but it doesn't work:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "CafeShopManagmentSystem",
            "request": "launch",
            "mainClass": "CafeShopManagmentSystem",
            "projectName": "CafeShopManagementSystem_4876995e",
            "vmArgs": "--module-path \"C:/java/lib\" --add-modules javafx.controls,javafx.fxml,**fontawesome-8.2"**
        },
        {
            "type": "java",
            "name": "Current File",
            "request": "launch",
            "mainClass": "${file}"
        }
        
    ]
}

FYI, the fontawesome library is in the same folder as the javafx library.

Solution

Try the following configuration:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "CafeShopManagmentSystem",
            "request": "launch",
            "mainClass": "CafeShopManagmentSystem",
            "projectName": "CafeShopManagementSystem_4876995e",
            "vmArgs": "--module-path \"C:/java/lib;C:/path/to/fontawesome-8.2.jar\" --add-modules javafx.controls,javafx.fxml",
            "classPaths": ["C:/path/to/fontawesome-8.2.jar"]
        },
        {
            "type": "java",
            "name": "Current File",
            "request": "launch",
            "mainClass": "${file}"
        }
    ]
}

Make sure to replace c:/path/to/fontawesome-8.2.jar with the actual path to the fontawesome jar file. Also, make sure the fontawesome jar file is in the correct location.

The above is the detailed content of How to add vmArgs for Fontawesmome library in VScode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete