{"id":18429482,"url":"https://github.com/jgneff/hello-javafx","last_synced_at":"2026-04-24T16:04:18.462Z","repository":{"id":155867422,"uuid":"317654582","full_name":"jgneff/hello-javafx","owner":"jgneff","description":"Project template for creating and deploying JavaFX apps","archived":false,"fork":false,"pushed_at":"2024-05-27T21:35:30.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T22:59:18.400Z","etag":null,"topics":["javafx","linux","snap"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jgneff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-01T20:05:02.000Z","updated_at":"2024-05-27T21:35:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0fd2b03-b07b-4b36-b194-2545b356945e","html_url":"https://github.com/jgneff/hello-javafx","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/jgneff/hello-javafx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgneff%2Fhello-javafx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgneff%2Fhello-javafx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgneff%2Fhello-javafx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgneff%2Fhello-javafx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgneff","download_url":"https://codeload.github.com/jgneff/hello-javafx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgneff%2Fhello-javafx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32230422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javafx","linux","snap"],"created_at":"2024-11-06T05:17:20.601Z","updated_at":"2026-04-24T16:04:18.441Z","avatar_url":"https://github.com/jgneff.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ![Duke, the Java mascot, waving](images/icon.png) Hello JavaFX!\n\nThis project is my template for building and packaging JavaFX applications. It follows the conventions of Apache Maven for its directory structure and includes a sample application that prints \"Hello World!\" to standard output when its button is pressed.\n\nThe files in this project let you:\n\n* open it with an integrated development environment (IDE),\n* build an executable Java archive (JAR),\n* run and test the application, and\n* package its documentation and source files.\n\nIn addition to these standard artifacts, you can build packages for Linux that include a minimal Java runtime image. The table below shows the file size and installed size of each package when built with OpenJDK 15. The Snap file is mounted as a compressed read-only file system, rather than extracted, so its installed size remains the same.\n\n| Package Type | File (MB) | Installed (MB) |\n| ------------ |:---------:|:--------------:|\n| Compressed archive | 31 | 92 |\n| Debian package     | 21 | 93 |\n| Snap package       | 96 | 96 |\n\nFurthermore, on Debian-based Linux distributions like Ubuntu, you can build all of these artifacts locally using only the trusted software from your system's package repositories.\n\n### Building\n\nThis project includes support for the following build automation tools:\n\n* [Apache Maven](https://maven.apache.org) - runs *online* with Maven Central or *offline* with a local Debian repo\n* [GNU Make](https://www.gnu.org/software/make/) - requires only the tools provided by the Java Development Kit (JDK)\n* [Snapcraft](https://snapcraft.io/build) - builds a self-contained application for any Linux distribution\n\nThe Maven `package` phase builds the following JAR files:\n\n* Module org.status6.hello.javafx\n    * target/hello-javafx-1.0.0.jar - JavaFX application\n    * target/hello-javafx-1.0.0-javadoc.jar - API documentation\n    * target/hello-javafx-1.0.0-sources.jar - Source code\n\nThe Makefile `package` target builds the same JAR files as Maven, but into the `dist` directory. The Makefile `linux` target, along with the `install` target run by Snapcraft, builds the following Linux packages:\n\n* dist/hello-javafx-1.0.0-linux-amd64.tar.gz - Compressed archive\n* dist/hello-javafx_1.0.0-1_amd64.deb - Debian package\n* hello-javafx_1.0.0_amd64.snap - Snap package\n\nThe Maven build can run on any system, but the Makefile is configured by default for Ubuntu. Whether you're running Windows, macOS, or Linux, you can use [Multipass](https://multipass.run) to build the project in an Ubuntu virtual machine (VM). For example, the following command will launch the Multipass [primary instance](https://multipass.run/docs/primary-instance) with 2 CPUs, 4 GiB of RAM, and Ubuntu 20.04 LTS (Focal Fossa):\n\n```console\n$ multipass launch --name primary --cpus 2 --mem 4G focal\n```\n\nRun all of the commands to build the software from the directory into which you cloned this repository, as follows:\n\n```console\n$ git clone https://github.com/jgneff/hello-javafx.git\n$ cd hello-javafx\n$ mvn clean package\n```\n\n#### Apache Maven\n\nThe Maven [Project Object Model](pom.xml) lets you build the project using an IDE, such as Apache NetBeans, or directly from the command line with the command:\n\n```console\n$ mvn clean package\n```\n\nBy default, the `mvn` command runs the build in *online* mode and downloads the required plugins and dependencies from the Maven Central Repository. On Debian-based systems such as Ubuntu, you can run the build in *offline* mode using a local repository of plugins and dependencies built by your Linux distribution.\n\nTo run the build locally, install Maven, the Maven Repo Helper, and the Maven plugins for building the Javadoc and source archives, as follows:\n\n```console\n$ sudo apt install maven maven-debian-helper\n$ sudo apt install libmaven-javadoc-plugin-java\n$ sudo apt install libmaven-source-plugin-java\n```\n\nAlso install the required JavaFX libraries into the local Debian repo with the command:\n\n```console\n$ sudo apt install openjfx\n```\n\nWith those packages installed, you can build offline using only the local Debian repository as shown below:\n\n```console\n$ mvn --settings /etc/maven/settings-debian.xml clean package\n```\n\nThe Debian settings for Maven contain just two items:\n\n```XML\n\u003c!--\n  This is a minimal settings.xml that switches maven to offline mode\n  and uses the Debian repo as the local repo.\n--\u003e\n\u003csettings\u003e\n  \u003clocalRepository\u003e/usr/share/maven-repo\u003c/localRepository\u003e\n  \u003coffline\u003etrue\u003c/offline\u003e\n\u003c/settings\u003e\n```\n\nAdd the following Bash alias to make the `mvn` command always use the Debian settings:\n\n```bash\n# ~/.bash_aliases\nalias mvn='mvn -s /etc/maven/settings-debian.xml'\n```\n\n#### GNU Make\n\nThe [Makefile](Makefile) builds the same JAR files as Maven, but it does so using only the tools and libraries that come with the Java Development Kit and the JavaFX Software Development Kit (SDK). You can install GNU Make and the latest release of OpenJDK and OpenJFX with the commands shown below. See the [OpenJDK Snap](https://github.com/jgneff/openjdk) and [OpenJFX Snap](https://github.com/jgneff/openjfx) repositories on GitHub for details.\n\n```console\n$ sudo apt install make\n$ sudo snap install openjdk\n$ sudo snap install openjfx\n```\n\nTo run all of the Makefile targets, you'll also need the JUnit testing framework and two extra packages for building the Debian package:\n\n```console\n$ sudo apt install junit4 binutils fakeroot\n```\n\nRun `make` with the targets shown below to build the JAR files into the `dist` directory and run the unit test cases:\n\n```console\n$ . $(openjdk)\n$ make clean package test\n```\n\nThe `run` target runs the application from its executable JAR file:\n\n```console\n$ make run\n```\n\nWith OpenJDK 14 or later, the Makefile can also package the project as a self-contained application in all of the following formats:\n\n* compressed archive for extracting to any location,\n* Debian package for installing into `/opt` on Debian-based systems, and\n* Snap package for testing and uploading to the [Snap Store](https://snapcraft.io/store).\n\nRun the following commands to build the compressed archive and Debian package for Linux:\n\n```console\n$ make linux\n```\n\n#### Snapcraft\n\nThe [snapcraft.yaml](snap/snapcraft.yaml) file defines the build for Snapcraft. Run the following commands to install Snapcraft and build the Snap package:\n\n```console\n$ sudo snap install snapcraft\n$ make clean\n$ snapcraft\n```\n\nSnapcraft launches a new Multipass VM to ensure a clean and isolated build environment. The VM is named `snapcraft-hello-javafx` and runs Ubuntu 20.04 LTS (Focal Fossa). The project's directory on the host system is mounted as `/root/project` in the guest VM, so any changes you make on the host are seen immediately in the guest, and vice versa.\n\n**Note:** If you run the initial `snapcraft` command itself inside a VM, your system will need *nested VM* functionality. See the [Build Options](https://snapcraft.io/docs/build-options) page for alternatives, such as running a remote build or using an LXD container.\n\nIf the build fails, you can run the command again with the `--debug` option to remain in the VM after the error:\n\n```console\n$ snapcraft -d\n```\n\nFrom within the VM, you can then clean the Snapcraft build and try again:\n\n```console\n# snapcraft clean app\nCleaning pull step (and all subsequent steps) for app\n# snapcraft\n```\n\nThe Snapcraft [*make* plugin](https://snapcraft.io/docs/make-plugin) uses the same [Makefile](Makefile) as before, but it runs GNU Make in the guest VM. The plugin runs `make` and `make install`, as shown below:\n\n```console\n# snapcraft\n  ...\nBuilding app\n+ make -j4\n  ...\n+ make -j4 install DESTDIR=/root/parts/app/install\n  ...\nSnapping...\nSnapped hello-javafx_1.0.0_amd64.snap\n```\n\n### Running\n\nAfter building the executable JAR file and installing the Linux packages, you can run the application in all of the following ways:\n\n* as the main class in a JAR file,\n* as the main class in a module,\n* from the compressed archive extracted into `~/opt`,\n* from the installed Debian package, and\n* from the installed Snap package.\n\nEach of these methods is shown below:\n\n```console\n$ java -p /snap/openjfx/current/sdk/lib --add-modules javafx.controls \\\n    -jar dist/hello-javafx-1.0.0.jar\nHello World!\n$ java -p dist/hello-javafx-1.0.0.jar:/snap/openjfx/current/sdk/lib \\\n    -m org.status6.hello.javafx\nHello World!\n$ ~/opt/hello-javafx/bin/HelloJavaFX\nHello World!\n$ /opt/hello-javafx/bin/HelloJavaFX\nHello World!\n$ hello-javafx\nHello World!\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgneff%2Fhello-javafx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgneff%2Fhello-javafx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgneff%2Fhello-javafx/lists"}