Skip to content

Instantly share code, notes, and snippets.

@greghelton
Created June 19, 2022 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greghelton/0d4620623538f55ae93a8b2a6f5d4a82 to your computer and use it in GitHub Desktop.
Save greghelton/0d4620623538f55ae93a8b2a6f5d4a82 to your computer and use it in GitHub Desktop.
JavaFX Command Line Compile
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
public class HelloFX extends Application {
@Override
public void start(final Stage stage) throws Exception {
final Circle circ = new Circle(40, 40, 30);
final Group root = new Group(circ);
final Scene scene = new Scene(root, 400, 300);
stage.setTitle("Hello JavaFX 2.0!");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
export PATH_TO_FX=/Users/me/dev/src/java/jfx-1/lib
javac --module-path $PATH_TO_FX --add-modules javafx.controls,javafx.fxml HelloFX.java
java --module-path $PATH_TO_FX --add-modules javafx.controls,javafx.fxml HelloFX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment