Site ControlsFX dit:
Si vous voulez jouer avec l'exemple d'application ControlsFX, il suffit de télécharger la version ControlsFX et exécutez la commande suivante sur l'invite de commande (assurez-vous de remplacer le * avec le numéro de version actuelle de FXSampler et ControlsFX-échantillons):
java -jar controlsfx-samples-*.jar
J'ai téléchargé ControlsFX 9.0.0 qui est dit être pour les utilisateurs de Java 9 et versions ultérieures.
Quand je lance que java -jar controlsfx-samples-9.0.0.jar
je reçois
Erreur: Impossible de trouver ou de charger fxsampler.FXSampler principale de classe
Causée par: java.lang.NoClassDefFoundError: JavaFX / application / Application
Mais c'est OK, comme selon Run HelloWorld en utilisant JavaFX 11 Guide , je dois ajouter des modules.
J'essaie donc java --module-path "C:\Program Files\Java\javafx-sdk-11\lib" --add-modules=javafx.controls -jar controlsfx-samples-9.0.0.jar
et je reçois
Manquant l'application JavaFX classe fxsampler.FXSampler
J'exécute toutes les commandes du controlsfx-9.0.0
répertoire qui contient controlsfx-9.0.0.jar
, controlsfx-samples-9.0.0.jar
et fxsampler-1.0.10.jar
.
Sortie java -version
pour moi:
Version OpenJDK "11.0.1" 16/10/2018
OpenJDK Runtime Environment 18.9 (build 11.0.1 + 13)
OpenJDK 64 bits serveur VM 18.9 (build 11.0.1 + 13, en mode mixte)
Les commentaires et suggestions sont appréciés.
Merci d'avance.
EDIT:
Après avoir suivi les conseils de Slaw et en cours d' exécution , java --module-path "C:\Program Files\Java\javafx-sdk-11\lib" --add-modules=javafx.controls,javafx.fxml,javafx.web -jar controlsfx-samples-9.0.0.jar
je reçois
Initialising FXSampler sample scanner...
Discovering projects...
Found project 'ControlsFX', with sample base package 'org.controlsfx.samples'
Exception in Application start method
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:566)
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:566)
at java.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.NoClassDefFoundError: Could not initialize class impl.org.controlsfx.version.VersionChecker
at org.controlsfx.control.ControlsFXControl.(ControlsFXControl.java:35)
at org.controlsfx.control.WorldMapView.(WorldMapView.java:93)
at org.controlsfx.samples.HelloWorldMapView.(HelloWorldMapView.java:55)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.Class.newInstance(Class.java:584)
at fxsampler.util.SampleScanner.discoverSamples(SampleScanner.java:86)
at fxsampler.FXSampler.start(FXSampler.java:106)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.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.InvokeLaterDispatcher$Future.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:174)
... 1 more
Exception running application fxsampler.FXSampler