Issue
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.
Solution
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>
Update:
Open the command palette with ctrl + shift + p, type settings
. You will see that there are three settings.json
files that can be opened.
Open Settings: VS Code global settings.
Open Workspace Settings: Only affects the current job.
Open Default Settings: All default settings of vscode.
So, putting the settings in the settings.json
that opens after selecting Open Settings will have an effect forever.
But there is one thing to note: if there is the same setting command in the settings.json
of the workspace, the global settings will be overwritten (only valid for the workspace).
Answered By - JialeDu
Answer Checked By - Mary Flores (JavaFixing Volunteer)