#JavaFx Visual studio class path

1 messages · Page 1 of 1 (latest)

icy marlin
#

my current class path file in vscode looks like this

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
  <classpathentry kind="src" path="src"/>
  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
    <attributes>
      <attribute name="module" value="true"/>
    </attributes>
  </classpathentry>
  <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
    <attributes>
      <attribute name="module" value="true"/>
    </attributes>
  </classpathentry>
  <classpathentry kind="lib" path="C:/javafx-sdk-20.0.1/lib/javafx.base.jar"/>
  <classpathentry kind="lib" path="C:/javafx-sdk-20.0.1/lib/javafx.controls.jar"/>
  <classpathentry kind="lib" path="C:/javafx-sdk-20.0.1/lib/javafx.fxml.jar"/>
  <classpathentry kind="lib" path="C:/javafx-sdk-20.0.1/lib/javafx.graphics.jar"/>
  <classpathentry kind="lib" path="C:/javafx-sdk-20.0.1/lib/javafx.media.jar"/>
  <classpathentry kind="lib" path="C:/javafx-sdk-20.0.1/lib/javafx.swing.jar"/>
  <classpathentry kind="lib" path="C:/javafx-sdk-20.0.1/lib/javafx.web.jar"/>
  <classpathentry kind="lib" path="C:/javafx-sdk-20.0.1/lib/javafx-swt.jar"/>
  <classpathentry kind="output" path="bin"/>
</classpath>

the vscode console prints this Error: JavaFX runtime components are missing, and are required to run this application
PS C:\Users\Ty\Documents\GitHub\MyHealth>

but does not give any syntax errors before compiling

stable totemBOT
#

<@&987246487241105418> please have a look, thanks.

stable totemBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

icy marlin
#

added to launch.json and settings.json

#

now im getting Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls.jar not found
PS C:\Users\Ty\Documents\GitHub\MyHealth>

#

launch.json

{
    // 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": "Current File",
            "request": "launch",
            "vmArgs": "--module-path \"C:/javafx-sdk-20.0.1/lib\" --add-modules javafx.controls,javafx.fxml",
            "mainClass": "${file}"
        },
        {
            "type": "java",
            "name": "Main",
            "request": "launch",
            "vmArgs": "--module-path \"C:/javafx-sdk-20.0.1/lib\" --add-modules javafx.controls,javafx.fxml",
            "mainClass": "Main",
            "projectName": "MyHealth"
        }
    ]
}
#

settings.json

{
    "java.project.referencedLibraries": [
        "lib/**/*.jar",
        "C:/javafx-sdk-20.0.1/lib/javafx.base.jar",
        "C:/javafx-sdk-20.0.1/lib/javafx.controls.jar",
        "C:/javafx-sdk-20.0.1/lib/javafx.fxml.jar",
        "C:/javafx-sdk-20.0.1/lib/javafx.graphics.jar",
        "C:/javafx-sdk-20.0.1/lib/javafx.media.jar",
        "C:/javafx-sdk-20.0.1/lib/javafx.swing.jar",
        "C:/javafx-sdk-20.0.1/lib/javafx.web.jar",
        "C:/javafx-sdk-20.0.1/lib/javafx-swt.jar"
    ]
}
mortal yacht
vocal fable
#

I actually had a ticket open and it turned out that IntelliJ (utilizing Maven) is a lifesaver. Is there any reason why you're currently using VS?

hidden mountain
#

I'm having this exact issue but with an old project that does use IntelliJ and Maven.

hidden mountain
icy marlin
mortal yacht
icy marlin
icy marlin