Skip to content

Instantly share code, notes, and snippets.

@itang
Created August 15, 2012 14:02
Show Gist options
  • Save itang/3360405 to your computer and use it in GitHub Desktop.
Save itang/3360405 to your computer and use it in GitHub Desktop.
Linux + jdk7u6 run javafx
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.text.Text;
public class HelloWorld extends Application {
public static void main(String[] args) {
HelloWorld.launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Group root = new Group();
root.getChildren().add(new Text(100, 100, "Hello,World"));
Scene scene = new Scene(root, 400, 400);
stage.setScene(scene);
stage.show();
}
}
itang@itang-pc ~/test $ javac -cp .:$JAVA_HOME/jre/lib/jfxrt.jar HelloWorld.java
itang@itang-pc ~/test $ java -cp .:$JAVA_HOME/jre/lib/jfxrt.jar HelloWorld
OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.
itang@itang-pc ~/test $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment