javavisual-studio-codejavafxtestfx

Unrecognized Option (vmArgs Java in VSCode)


I'm trying run package org.testfx in my JavaFX application, but i'm a facing error "JavaFX.graphics is not accessible". So I'm trying put vmArgs in VsCode tests to exports javafx.graphics, but not sucessfuly, one help?

The new error: Unrecognized option: --add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED

My Code:

"java.test.config":
        {
            "name": "testConfig",
            "workingDirectory": "${workspaceFolder}",
            "vmArgs": ["--add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED"]
        }

Solution

  • Well... I resolved the problem, but not the way I expected.

    Resolution

    I removed the module-info.java to have no problem with access modules, apparently have just this option, so I have other problem, but nothing that interrupts my application.

    the problem: WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @4f10c7de'.

    I resolved this with put vmArgs in launch.json on vscode:

    "--module-path \"location-javafx\\lib\" --add-modules javafx.controls,javafx.graphics,javafx.fxml".

    What I wanted?

    I want to make a test automatized with org.testfx, for test all process my application and minimize bugs.

    To persons who have this problem, if that way don't working for you, try these links:

    StackOverflow

    VSCode's site and GitHub

    If anyone can find another answer, please share with me, please.