当我尝试运行我的javaFX应用程序时,我得到了以下堆栈跟踪,如何解决这个问题?到底是什么导致了这个问题?除了一个旧的dataFX库,我没有删除任何东西。我使用的是eclipse和最新版本的java,以及javaFX插件。
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$147(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$48/1732398722.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: javax/inject/Inject
at io.datafx.controller.injection.InjectResourceType.getSupportedAnnotation(InjectResourceType.java:55)
at io.datafx.controller.context.ContextResolver.getAnnotatedControllerResourceTypes(ContextResolver.java:87)
at io.datafx.controller.context.ContextResolver.injectResources(ContextResolver.java:49)
at io.datafx.controller.ViewFactory.createByController(ViewFactory.java:171)
at io.datafx.controller.flow.FlowHandler.start(FlowHandler.java:140)
at io.datafx.controller.flow.Flow.startInStage(Flow.java:406)
at application.MainApp.start(MainApp.java:16)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$51/1285177093.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/1051754451.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$164(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/483857893.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/1775282465.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(Unknown Source)
at com.sun.glass.ui.win.WinApplication$$Lambda$37/1109371569.run(Unknown Source)
... 1 more
Caused by: java.lang.ClassNotFoundException: javax.inject.Inject
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 21 more
Exception running application application.MainApp发布于 2015-01-30 01:29:27
javax.inject是一个JavaEE框架,它不包含在JavaSE 8发行版中。您需要在项目中捆绑一个额外的库,其中包含一个javax.inject实现。我相信afterburner.fx是JavaFX的瘦框架的一个例子,它包含了一个javax.inject实现。
https://stackoverflow.com/questions/28217034
复制相似问题