Home > Mobile >  How to add JavaFX javadocs to vscode when not using build tools
How to add JavaFX javadocs to vscode when not using build tools

Time:06-17

I would like to add the documentation for JavaFX to vscode so that when I hover over functions it tells me what they do. I have downloaded the Javadocs from the JavaFX website but I don't know what to do with them now. I'm creating my projects without any build tools through vscode. Any help would be appreciated.

CodePudding user response:

Please try adding the following configuration in your setting.json file.

"java.project.referencedLibraries": {
    "include": [
        "lib/**/*.jar",
        "%PATH_TO_FX%/lib/*.jar"
    ],
    "sources": {
        "%PATH_TO_FX%/lib/javafx.base.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.controls.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.fxml.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.graphics.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.media.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.swing.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.web.jar": "%PATH_TO_FX%/src.zip",
        "%PATH_TO_FX%/lib/javafx.swt.jar": "%PATH_TO_FX%/src.zip"
    }
}

%PATH_TO_FX% is your javafx folder path.

another possible approach

for example, a project like this:

/project
 /lib
  test-1.0.0.jar
 /doc
  test-1.0.0-javadoc.jar

add in your .classPath :

<classpathentry kind="lib" path="lib/test-1.0.0.jar">
  <attributes>
    <attribute name="javadoc_location" value="jar:platform:/resource/project/doc/test-1.0.0-javadoc.jar!/" />
  </attributes>
</classpathentry>
  • Related