-2

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"]
        }
kauan
  • 15
  • 3
  • See the documentation on using [JavaFX plus VSCode](https://openjfx.io/openjfx-docs/). You also want to use TestFX, which will be additional work. But make sure you can at least run the basic HelloWorld app from the linked tutorial in your environment. – jewelsea Oct 14 '22 at 20:03
  • 1
    @jewelsea I can run the JavaFX in VSCode, my application run perfectly, but my problem is, I want to make a test automatized with **org.testfx**, for test all process my application. My problem: **org.testfx** need to access **javafx.graphics**, but my application is modular, and cannot be access in **javafx.graphics**. My Questions: How can i put **vmArgs** `"--add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED"` for tests. – kauan Oct 15 '22 at 13:53
  • Welcome to Stack Overflow. Please read [ask] on how to improve the quality of your question. My thought is that you should check your grammar and please post your error as text. – HoRn Oct 15 '22 at 14:21

1 Answers1

0

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.

kauan
  • 15
  • 3