2017-09-15 5 views
0

私はこのjavafx 3d tutorialに従っていますが、私は次のエラーが出ます(この問題は32bit gtk2パッケージとライブラリをインストールすることによっていくつかの初期エラーをクリアしました)それには似ているようだ。私は同じエラーで何もオンラインでは見つけられませんでした。InvocationTargetExceptionは基本的なjavafxアプリケーションでNullPointerによって発生しました

注:私はFXMLファイルを持っていない(私はコードでそれをすべて設定すると、私は私は1つを必要としないと思う)

のUbuntu 16.04.3小学校OSロキ

エラーメッセージを実行します:

Gtk-Message: Failed to load module "pantheon-filechooser-module" 
Gtk-Message: Failed to load module "gail" 
Gtk-Message: Failed to load module "atk-bridge" 
Gtk-Message: Failed to load module "canberra-gtk-module" 
Exception in thread "main" java.lang.reflect.InvocationTargetException 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:498) 
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767) 
Caused by: java.lang.NullPointerException 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:498) 
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389) 
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328) 
... 5 more 

コード:

import javafx.application.Application; 
import javafx.scene.Group; 
import javafx.scene.PerspectiveCamera; 
import javafx.scene.PointLight; 
import javafx.scene.Scene; 
import javafx.scene.shape.Box; 
import javafx.stage.Stage; 

public class GraphicsApplication extends Application { 

public void main(String[] args) { 
    launch(args); 
} 

@Override 
public void start(Stage primaryStage) throws Exception { 
    Box box = new Box(100,100,100); 
    box.setTranslateX(150); 
    box.setTranslateY(100); 

    PointLight light = new PointLight(); 
    light.setTranslateX(300); 
    light.setTranslateY(350); 
    light.setTranslateZ(200); 

    PerspectiveCamera camera = new PerspectiveCamera(); 
    camera.setTranslateX(100); 
    camera.setTranslateY(-50); 
    camera.setTranslateZ(300); 

    Group root = new Group(box, light); 

    Scene scene = new Scene(root, 400, 200, true); 
    scene.setCamera(camera); 

    primaryStage.setScene(scene); 
    primaryStage.setTitle("Super test 5000"); 
    primaryStage.show(); 
} 
} 
+0

完全なスタックトレースですか? –

+0

ええ、それは明示的に私のコードからです: – ollie299792458

答えて

2

main()方法はである必要があります。

+0

私の神、今私は愚かな感じ、ありがとうございます。 – ollie299792458

関連する問題