Imagine your jdk 8 home directory is on your shell path.
Create Love.java:
import javafx.stage.*; import javafx.application.*; import javafx.scene.control.*; import javafx.scene.*; public class Love extends Application { public void start(Stage stage) throws Exception { Scene scene = new Scene(new Label("hello, world")); scene.getStylesheets().add("love.css"); stage.setScene(scene); stage.show(); } }
Compile it:
javac Love.java
Create love.css:
.label { -fx-text-fill: firebrick; }
Compile it:
javafxpackager -createbss -srcfiles love.css -outdir . -outfile love
This will create love.bss
Now you can delete love.css because you no longer need it because you made binary love.
Now run the application:
java Love
Even if you requested love.css , the JavaFX runtime was smart enough to recognize that you have the binary love.bss , and use this to apply CSS styles in your application.

source share