0

Ok, so I'm new to JavaFX and am trying to understand. I use VSCode as my preferred software. I had this working literally yesterday but now it doesn't work again and I'm once again at a complete loss. I keep tripping this error, and I do not understand why. I have added the vmArgs and loaded the Jars correctly:

{
    // 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": "Launch Current File",
            "request": "launch",
            "mainClass": "${file}"
        },
        {
            "type": "java",
            "name": "Launch characterSheet",
            "request": "launch",
            "mainClass": "characterSheet",
            "vmArgs": "-module-path E:/Documents/School/2021/04 - Java/javafx-sdk-16/lib -add-modules javafx.controls,javafx.fxml", 
            "projectName": "FinalProject_6830cf84"
        }
    ]
}

I straight up feel like I'm going insane trying to figure this out. It keeps flickering between the following errors: "Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit." and "Error: JavaFX runtime components are missing, and are required to run this application".

I have done the following:

  • Loaded the JARS into the extended library.
  • Did the "vmargs" bit in launch.json.
  • Added _JAVA_OPTIONS: -Xmx512M to limit memory.

I seriously don't have the time or energy for this, it took me like 15 hours to figure this out the first time... I just want to work on my final.

  • https://stackoverflow.com/questions/54349894/javafx-11-with-vscode – SedJ601 May 07 '21 at 23:37
  • I don't see how this relates to my question, or what part of this very long tutorial relates to me. Thank you though? – Hawkshot86 May 08 '21 at 03:43
  • I would suggest creating a new project and following the linked answer step by step. – SedJ601 May 08 '21 at 13:50
  • So I tried it, but it didn't work. I don't think it was clear above, but I am literally brand new to Java - this is for my final for my intro to java class. I'm not coming over from Eclipse, I only use VScode, so I don't understand any of the Eclipse parts. Further, this tutorial is talking about and referencing things I do not know and have never heard of. – Hawkshot86 May 08 '21 at 17:49
  • I am not sure why you are mentioning Eclipse. The link I posted above does not mention Eclipse at all. Since you can't figure out that route, I would suggest you take a different one. I like `Netbeans Modular with Maven`. https://openjfx.io/openjfx-docs/ – SedJ601 May 08 '21 at 18:17
  • The path in windows vscode should be `E:\\Documents\\...`, You may try [this solution](https://github.com/microsoft/vscode-java-debug/issues/507#issuecomment-528150493) and see if error goes away. – Molly Wang-MSFT May 09 '21 at 02:03
  • Another workaround post in [this reply](https://stackoverflow.com/questions/59771324/error-javafx-runtime-components-are-missing-and-are-required-to-run-this-appli) is to avoid the Java launcher check and will let the application run. please have a try. – Molly Wang-MSFT May 09 '21 at 02:09

0 Answers0