I downloaded from the unpacked javafx sdk In the folder C: \ Program Files \ Java \ javafx-sdk-11.
I create the empty JavaFx project In Intellij Idea. In the settings in the Project SDK, I specify the path to jdk 11, give the project a name, then in the project in Project Scructure I add the libraries to the path to C: \ Program Files \ Java \ javafx-sdk-11 \ lib. The javafx libraries are added to the project.
Trying to run a project gives an error
Error: JavaFX runtime components are missing, and are required to run this application Then I found on SO the solution that I need in Run-> Edit Configurations -> VM Options to insert the path - --module-path="C:\Program Files\Java\javafx-sdk-11\lib" --add-modules=javafx.controls
I insert and at start gives an error
Exception in Application start method java.lang.reflect. ) at java.base / jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.base / java.lang.reflect.Method.invoke (Method.java:566) at javafx.graphics/com. sun.javafx.application.LauncherImpl.launchApplicationWithArgs (LauncherImpl.java:464) at javafx. NativeMethodAccessorImpl.invoke0 (Native Method) at java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62mgd.doc.http java.base / java.lang.reflect.Method.invoke (Method.java def66) at jav a.base / sun.launcher.LauncherHelper $ FXHelper.main (LauncherHelper.java:1051) Caused by: java.lang.RuntimeException: Exception in Application start method at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1 (LauncherImpl.java:900) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base / java.lang.Thread.run (Thread.java: 834) Caused by: java.lang.IllegalAccessError: class com.sun.javafx.fxml.FXMLLoaderHelper (in unnamed module @ 0x555df7da) cannot access class com.sun.javafx.util.Utils (in module javafx.graphics) because module javafx .graphics does not export com.sun.javafx.util to unnamed module @ 0x555df7da at com.sun.javafx.fxml.FXMLLoaderHelper. (FXMLLoaderHelper.java:38) at javafx.fxml.FXMLLoader. (FXMLLoader.java:2056) at sample.Main.start (Main.java:13) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.appli cation.PlatformImpl.lambda $ runAndWait $ 12 (PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java Tic28) at java.base / java.sean.lambda$runLater$10(PlatformImpl.java Tic28) at java.base / java.sean.lambd AccessController.doPrivileged (Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcherAFl.34 run (InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop (Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop $ 3 (WinApplication.java:17) ... 1 more Exception running application sample.Main
Please tell me how to properly connect JavaFX? What am i doing wrong