A minimal text editor, third in a series - the first in C, the second using python-Gtk and now this one written in Java and using Java-GI Gtk/Adw bindings. Each is packaged as a flatpak. The first two were developed in GNOME Builder and this one I developed in eclipse using a modified fork of the uk.co.bithatch:maven-flatpak-plugin to create flatpak artifacts. Have a look at the pom.xml configuration for details.
The code is compiled with Java 22 (the minimum for Java-GI) and is packaged in a container with flatpak runtime org.gnome.Platform and org.gnome.Sdk 48 that includes the openjdk-23.0.2 JRE that runs the application.
You'll need flatpak and a Java JDK >= 22 installed.
Along the way you may get some errors about missing flatpak runtimes. These can be fixed by installing them via, e.g.:
flatpak install flathub org.gnome.Platform
If you're using eclipse, use the texty3-BUILD.launch run configuration. Or run:
mvn clean package ca.footeware:flatpak-maven-plugin:generate
This populates the target folder, including an app folder with artifacts needed for a flatpak-builder call. The app folder should look like this:
❯ tree ./app
./app
├── ca.footeware.java.texty3.desktop
├── ca.footeware.java.texty3.metainfo.xml
├── ca.footeware.java.texty3.svg
├── ca.footeware.java.texty3.yml
├── texty3
└── texty3.jar
From the app folder, run the following to build the flatpak and install it locally.
flatpak-builder --force-clean --user --verbose --install build-dir ca.footeware.java.texty3.yml
If you get errors, running this can provide better explanations. Some pom.xml tags are used but I think I've got the required ones.
flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream ca.footeware.java.texty3.metainfo.xml
To run the installed flatpak, use:
flatpak run ca.footeware.java.texty3
Or use the launcher that should now be in your apps view. Or use Warehouse.
This can be double-clicked to install in GNOME Software.
flatpak-builder --repo=repo --force-clean build-dir ca.footeware.java.texty3.ymlflatpak build-bundle repo ca.footeware.java.texty3.flatpak ca.footeware.java.texty3
Warehouse is a great program to manage flatpaks, including verifying installation, running and removal.
Note that the flatpak-builder --force-clean --user --verbose --install build-dir ca.footeware.java.texty3.yml command as described above installs the app with user scope while installing the .flatpak build will install in system scope. This needs reconciliation.
A couple commands I've found that might help:
- Source verification:
flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream ca.footeware.java.texty3.metainfo.xml - Container info:
flatpak info ca.footeware.java.texty3 - Attach to running container:
flatpak run --command=sh ca.footeware.java.texty3. Once connected,cd /appto see your files. You can check the version of java installed in/app/jre.
To remove this fine piece of work, use Warehouse or run:
flatpak uninstall --delete-data ca.footeware.java.texty3
- Code tweaks.
- Release texty3.flatpak as installable on clients.
- Consider integrating flatpak-builder calls.