3

I have made an OpenJFX project and am running it with the following options:

--module-path ${JAVAFX_HOME} --add-modules=javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web

This works as expected and creates the application upon running. The problem is with VSCode linting. It says that "package javafx.application does not exist" amongst other packages. Is there a way to point VSCode to the packages or something along those lines. How can I get intellisense to work with OpenJFX.

I am running on Ubuntu 22.04.3 with java version openjdk 20.0.1.

I have tried changing the classpath in VSCode and adding the jars to the referenced libraries.

Robert
  • 7,394
  • 40
  • 45
  • 64
StckSmsh
  • 31
  • 3
  • 2
    JPMS module is not supported for the project without build tools right now. But you may have other options, see: "JavaFX and Visual Studio Code" in https://openjfx.io/openjfx-docs/ – Sheng Chen Aug 29 '23 at 00:41
  • 2
    I don’t know VS code, but perhaps if you use a JDK that includes JavaFX like Azul Zulu JDK FX or BellSoft Liberica Full JDK, the Intellisense might work as you wish. That should require no VM options, IDE library settings or other configuration. – jewelsea Aug 29 '23 at 02:52
  • 1
    Does this [question](https://stackoverflow.com/questions/72625811/how-to-add-javafx-javadocs-to-vscode-when-not-using-build-tools) help? – JialeDu Aug 29 '23 at 08:54

0 Answers0