Я получил эту ошибку, когда я пытаюсь запустить свой код с помощью оператора "LauncherImpl". Кто-нибудь знает, как это исправить?
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.IllegalAccessError: class application.view1controller (in unnamed module @0x3fb6a447) cannot access class com.sun.javafx.application.LauncherImpl (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.application to unnamed module @0x3fb6a447
at application.view1controller.main(view1controller.java:24)
... 11 more
Exception running application application.view1controller
package application;
import com.sun.javafx.application.LauncherImpl;
import javafx.application.Application;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.stage.Stage;
import javafx.scene.Parent;
import javafx.scene.Scene;
public class view1controller extends Application {
public void start(Stage view1) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("/application/view1.fxml"));
Scene scene = new Scene(root);
view1.setScene(scene);
view1.show();
}
public static void main(String[] args) {
LauncherImpl.launchApplication(view1controller.class, SplashScreen.class, args);
}
VM Аргументы: --module-path "D: \ Fabian Boni \ Documents \ eclipse workspace \ javafx-sdk-11.0.2 \ lib" - дополнительные модули javafx.controls, javafx.f xml, javafx.base, javafx.graphics