2013-05-15 123 views
1

我在這裏遇到了由Netbeans生成的javafx應用程序jar問題。 事實上,如果我在Netbeans內運行,一切都運行得很好。然而,當我使用命令行並嘗試運行原先由NetBeans中創建我的應用程序的罐子,使用命令:無法在Netbeans之外運行javafx JAR

java -jar SequenceAlign.jar 

我在終端得到的錯誤很多。 錯誤有以下幾種:

java.lang.NullPointerException 

file:/Users/tsukanomon/NetBeansProjects/SequenceAlign/dist/SequenceAlign.jar!/sequencealign/bioGUI.fxml 

    at sequencealign.bioGUIController.getMatrixSubNames(bioGUIController.java:110) 
    at sequencealign.bioGUIController.populateComboSubMatrix(bioGUIController.java:99) 
    at sequencealign.bioGUIController.initialize(bioGUIController.java:137) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2152) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2028) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2742) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2721) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2707) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2694) 
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2683) 
    at sequencealign.SequenceAlign.start(SequenceAlign.java:21) 
    at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319) 
    at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206) 
    at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173) 
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76) 
    Exception in Application start method 

java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:601) 
at com.javafx.main.Main.launchApp(Main.java:642) 
at com.javafx.main.Main.main(Main.java:805) 
Caused by: java.lang.RuntimeException: Exception in Application start method 
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403) 
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47) 
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115) 
at java.lang.Thread.run(Thread.java:722) 
Caused by: java.lang.NullPointerException 
at sequencealign.bioGUIController.getMatrixSubNames(bioGUIController.java:110) 
at sequencealign.bioGUIController.populateComboSubMatrix(bioGUIController.java:99) 
at sequencealign.bioGUIController.initialize(bioGUIController.java:137) 
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2152) 
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2028) 
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2742) 
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2721) 
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2707) 
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2694) 
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2683) 
at sequencealign.SequenceAlign.start(SequenceAlign.java:21) 
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319) 
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206) 
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173) 
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76) 
2013-05-15 02:14:38.924 java[48780:2517] [JRSAppKitAWT markAppIsDaemon]:Process manager   already initialized: can't fully enable headless mode. java.lang.reflect.InvocationTargetException 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:601) 
at com.javafx.main.Main$2.run(Main.java:881) 
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:241) 
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721) 
at java.awt.EventQueue.access$200(EventQueue.java:103) 
at java.awt.EventQueue$3.run(EventQueue.java:682) 
at java.awt.EventQueue$3.run(EventQueue.java:680) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) 
at java.awt.EventQueue.dispatchEvent(EventQueue.java:691) 
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) 
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) 
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) 
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) 
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) 
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) 
Caused by: java.awt.HeadlessException 
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207) 
at java.awt.Window.<init>(Window.java:535) 
at java.awt.Frame.<init>(Frame.java:420) 
at java.awt.Frame.<init>(Frame.java:385) 
at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1759) 
at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1834) 
at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1697) 
at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:863) 
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:667) 
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:638) 
... 19 more 

我的規格是:

  • 的Mac OS X山獅10.8.3
  • Java版本 「1.7.0_11」
  • 的Java(TM)SE運行環境(build 1.7.0_11-b21)
  • Java HotSpot™64位
  • 服務器虛擬機(內部版本23.6-b04,混合模式)
  • Netbeans 7.2.1

感謝所有提前幫忙!!!!!

+0

您是否試圖運行可執行文件? – vijayk

回答

0

Netbeans沒有導入所有必要的庫來運行我的應用程序,所以我不得不手動添加一些jar /庫,即使我已經添加了我的項目的屬性。

+0

您也可以通過netbeans導入所有庫,使用netbeans來部署或創建您的jar,並且它可以很好地工作。 –