A Java implementation for Desktop Entry Files in Linux
Java 14 and up
Add the JAR file to your project.
In Gradle for example:
implementation fileTree(dir: 'libs', include: '*.jar')
Create a new DesktopEntryFile object with new DesktopEntryFile(). Use methods like .withIcon() to set the path to the icon.
When you are done use .safeToFile() to generate the .desktop file.
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html