Created
August 15, 2012 14:02
-
-
Save itang/3360405 to your computer and use it in GitHub Desktop.
Linux + jdk7u6 run javafx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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