--Windows 10 + Visual Studio Code (1.37.0 latest at the time of writing)
Recently, a Visual Studio Code installer for Java development came out, but I haven't tried it this time (because the Java runtime environment itself was created before this). It seems that the JDK is not OpenJDK but AdoptOpenJDK.
Download JavaFX from the Official Site. At the time of writing, versions for JDK 12 and LTS for JDK 11 are available. If you have an SDK, you can run it first, so we will introduce the SDK. DL destination is here
Next, expand the DL file to any location.
This time, I put the extracted files in C: \ Users \ myuser \ Documents \ jfx \
.
Add JavaHome to settings.json
in Visual Studio Code
Please add according to your environment. If you have already built the environment, it may have been added. (IntelliSense itself works even if Java Home is not set, so set from here this time)
Add debug configuration
Add the Visual Studio Code debug settings.
If you click the bug mark (the icon changes depending on the version) on the sidebar and click the gear mark, launch.json
will start in the editor, so add it here.
I will add it here.
"vmArgs": "--module-path C:\\Users\\myuser\\Documents\\jfx\\javafx-sdk-11.0.2\\lib --add-modules javafx.controls,javafx.fxml"
Add the PATH to the JavaFX lib directory extracted earlier and the module name to be used as shown in.
This makes it possible to check the execution result using debug mode with the F5 key from Visual Studio Code.
I think this method is useful when it is a little difficult to run Eclipse on the CPU of a laptop computer. However, the Java extension itself is reasonably heavy, so it's a little better than Eclipse, and it's psychologically easier to think about.
Recommended Posts