Skip to content

Fix icon on Linux#15188

Merged
Siedlerchr merged 12 commits into
mainfrom
fix-icon
Feb 22, 2026
Merged

Fix icon on Linux#15188
Siedlerchr merged 12 commits into
mainfrom
fix-icon

Conversation

@koppor

@koppor koppor commented Feb 22, 2026

Copy link
Copy Markdown
Member

Related issues and pull requests

PR Description

Fixes icons

Steps to test

See icon working :)

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if change is visible to the user)
  • [/] I added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • [/] I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • [/] I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@koppor koppor added the dev: binaries Binary builds should be uploaded to builds.jabref.org label Feb 22, 2026
GenericName=BibTeX Editor
Comment=APPLICATION_DESCRIPTION
Exec=APPLICATION_LAUNCHER
STARTUP_DIRECTORY

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks odd but this is correct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah seems like they introduce it recently, because in the tag it's not yet there for jdk25 https://github.com/openjdk/jdk/blob/jdk-25%2B36/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.desktop

@Siedlerchr

Copy link
Copy Markdown
Member

Might be related #14965

@Siedlerchr

Copy link
Copy Markdown
Member

<WixVariable Id="WixUIBannerBmp" Value="..\..\..\..\..\buildres\windows\JabRefTopBanner.bmp" />

@testlens-app

testlens-app Bot commented Feb 22, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: b9d94f0
▶️ Tests: 4843 executed
🟡 Checks: 48/64 completed


Learn more about TestLens at testlens.app.

@koppor

koppor commented Feb 22, 2026

Copy link
Copy Markdown
Member Author

Current state:

AppImage has icon again

image

But .deb does not.

image

@koppor

koppor commented Feb 22, 2026

Copy link
Copy Markdown
Member Author
image

Works for Debian again.

@koppor

koppor commented Feb 22, 2026

Copy link
Copy Markdown
Member Author
light.exe : error LGHT0103 : The system cannot find the file 'C:\Users\olive\AppData\Local\Temp\jdk.jpackage6240016526437881529\wixobj\main.wixobj' with type 'Source'.

Update workaround at b9d94f0 (this PR) - also mentioned at gradlex-org/java-module-packaging#108 (comment)

@Siedlerchr

Copy link
Copy Markdown
Member

do you have verbose enabled for windows jpackager call?

@koppor

koppor commented Feb 22, 2026

Copy link
Copy Markdown
Member Author

do you have verbose enabled for windows jpackager call?

gradlex-org/java-module-packaging#107 (comment)

@koppor

koppor commented Feb 22, 2026

Copy link
Copy Markdown
Member Author
grafik grafik

@Siedlerchr

Copy link
Copy Markdown
Member

Gemini suggests
<WixVariable Id="WixUIBannerBmp" Value="$(var.JpConfigDir)\JabRefTopBanner.bmp" />

@koppor koppor mentioned this pull request Feb 22, 2026
1 task
@koppor

koppor commented Feb 22, 2026

Copy link
Copy Markdown
Member Author

Gemini suggests <WixVariable Id="WixUIBannerBmp" Value="$(var.JpConfigDir)\JabRefTopBanner.bmp" />

Would do it in a follow-up. First fix Linux :)

@koppor koppor changed the title [WIP] Fix icon Fix icon on Linux Feb 22, 2026
@koppor koppor marked this pull request as ready for review February 22, 2026 15:17
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Fix icon handling and restructure jpackage configuration per OS

✨ Enhancement 🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Restructure jpackage configuration to properly handle platform-specific icons
• Add jpackageResources directory configuration for each target OS
• Include appImageOptions with icon paths for Windows, Linux, macOS
• Consolidate license file and file associations across all targets
• Update documentation and desktop entry file formatting
Diagram
flowchart LR
  A["jpackage Config"] --> B["Windows Target"]
  A --> C["Linux Target"]
  A --> D["macOS Target"]
  B --> E["Icon + Resources"]
  C --> E
  D --> E
  E --> F["Platform-specific Installers"]
Loading

Grey Divider

File Changes

1. jabgui/build.gradle.kts ⚙️ Configuration changes +50/-12

Restructure jpackage config with platform-specific resources

• Reorganized jpackage configuration with global settings and per-target overrides
• Added jpackageResources directory paths for Windows, Linux, and macOS
• Added appImageOptions block with platform-specific icon paths for each OS
• Moved --license-file to be included in all target configurations
• Restructured options with comments distinguishing generic vs target-specific settings
• Fixed Linux icon path from src/main/resources/icons/JabRef-linux-icon-64.png to
 buildres/linux/JabRef.png
• Added --resource-dir for Linux and macOS targets
• Removed trailing semicolon from Linux --linux-menu-group value

jabgui/build.gradle.kts


2. .vscode/ltex.dictionary.en-US.txt 📝 Documentation +1/-0

Add jpackage to dictionary

• Added jpackage to the spell-check dictionary

.vscode/ltex.dictionary.en-US.txt


3. docs/code-howtos/jpackage.md 📝 Documentation +15/-5

Improve jpackage documentation structure and clarity

• Changed title from "JPackage" to "jpackage" for consistency
• Reorganized section structure with "Building locally" as main heading
• Added Debian/Ubuntu preparation instructions for installing rpm package
• Moved Windows WiX Toolset installation under separate subsection
• Added code block formatting for the gradle build command
• Added note about output location in jabgui/build/packages/

docs/code-howtos/jpackage.md


View more (2)
4. jabgui/buildres/linux/JabRef.desktop ⚙️ Configuration changes +4/-2

Reorder desktop entry fields for consistency

• Reordered desktop entry fields for better organization
• Moved Comment field before Exec
• Added STARTUP_DIRECTORY field
• Moved Categories before DESKTOP_MIMES
• Moved GenericName to end of file
• Added blank line before GenericName for visual separation

jabgui/buildres/linux/JabRef.desktop


5. jabgui/buildres/windows/JabRef.VisualElementsManifest.xml Additional files +0/-0

...

jabgui/buildres/windows/JabRef.VisualElementsManifest.xml


Grey Divider

Qodo Logo

@Siedlerchr Siedlerchr merged commit a7b7572 into main Feb 22, 2026
63 of 65 checks passed
@Siedlerchr Siedlerchr deleted the fix-icon branch February 22, 2026 15:18
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (3) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Commented-out --resource-dir option 📘 Rule violation ✓ Correctness
Description
New commented-out code was introduced in the Gradle build script, increasing noise and encouraging
dead/uncertain configuration to accumulate.
Code

jabgui/build.gradle.kts[87]

+            // "--resource-dir", layout.projectDirectory.dir("buildres").dir("windows").asFile.absolutePath,
Evidence
PR Compliance ID 11 forbids introducing commented-out code. The new line comments out a
--resource-dir option inside options.addAll(...).

AGENTS.md
jabgui/build.gradle.kts[87-87]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A commented-out configuration line (`--resource-dir`) was added to the Gradle build script.

## Issue Context
The project guideline prohibits commented-out code to avoid dead code accumulation and review noise.

## Fix Focus Areas
- jabgui/build.gradle.kts[87-87]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Duplicate resource dir config 🐞 Bug ⛯ Reliability
Description
Linux and macOS packaging set both jpackageResources and pass an explicit --resource-dir option.
If the plugin already maps jpackageResources to --resource-dir, the resulting jpackage
invocation can be ambiguous or fail due to duplicate flags.
Code

jabgui/build.gradle.kts[R103-116]

    targetsWithOs("linux") {
+        jpackageResources = layout.projectDirectory.dir("buildres").dir("linux")
+        appImageOptions.addAll(
+            // Generic options, but different for each target
+            "--icon", "$projectDir/buildres/linux/JabRef.png",
+        )
        options.addAll(
-            "--linux-menu-group", "Office;",
+            // Needs to be listed everyhwere, because of https://github.com/gradlex-org/java-module-packaging/issues/104
+            "--license-file", "$projectDir/buildres/LICENSE_with_Privacy.md",
+
+            // Generic options, but different for each target
+            "--icon", "$projectDir/buildres/linux/JabRef.png",
+            "--file-associations", "$projectDir/buildres/linux/bibtexAssociations.properties",
+            "--resource-dir", layout.projectDirectory.dir("buildres").dir("linux").asFile.absolutePath,
Evidence
In the linux target, the resource directory is configured twice: once via the DSL property
(jpackageResources) and again via the raw jpackage CLI flag (--resource-dir). The same pattern
is repeated for macOS, increasing the likelihood of duplicated/competing configuration at execution
time.

jabgui/build.gradle.kts[103-122]
jabgui/build.gradle.kts[128-146]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Linux and macOS targets configure the jpackage resources directory twice (DSL + explicit `--resource-dir`). This can lead to duplicated CLI args or unclear precedence.

### Issue Context
The `javaModulePackaging` DSL already has `jpackageResources`; adding `--resource-dir` manually is likely redundant and risky.

### Fix Focus Areas
- jabgui/build.gradle.kts[103-122]
- jabgui/build.gradle.kts[128-146]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. everyhwere typo in comment 📘 Rule violation ✓ Correctness
Description
A new comment contains the misspelling everyhwere, which reduces clarity and violates the
requirement to fix typographical errors in comments/documentation.
Code

jabgui/build.gradle.kts[81]

+            // Needs to be listed everyhwere, because of https://github.com/gradlex-org/java-module-packaging/issues/104
Evidence
PR Compliance ID 33 requires introduced comments/documentation to be free of typographical errors.
The added comment line includes the misspelling everyhwere.

jabgui/build.gradle.kts[81-81]
Best Practice: Learned patterns

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new comment in `jabgui/build.gradle.kts` contains a typographical error (`everyhwere`).

## Issue Context
This violates the project requirement to fix/avoid typos in comments and documentation.

## Fix Focus Areas
- jabgui/build.gradle.kts[81-81]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Target-speccific typo comment 📘 Rule violation ✓ Correctness
Description
A new comment contains the misspelling Target-speccific, which reduces clarity and violates the
requirement to fix typographical errors in comments/documentation.
Code

jabgui/build.gradle.kts[89]

+            // Target-speccific options
Evidence
PR Compliance ID 33 requires introduced comments/documentation to be free of typographical errors.
The added comment line includes the misspelling Target-speccific.

jabgui/build.gradle.kts[89-89]
Best Practice: Learned patterns

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new comment in `jabgui/build.gradle.kts` contains a typographical error (`Target-speccific`).

## Issue Context
This violates the project requirement to fix/avoid typos in comments and documentation.

## Fix Focus Areas
- jabgui/build.gradle.kts[89-89]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Linux menu category format 🐞 Bug ✓ Correctness
Description
The Linux menu group is set to Office (no trailing semicolon), while other desktop entries in the
repo use Office;. This risks generating a .desktop Categories value that is inconsistently
formatted and potentially ignored/misclassified by desktop environments.
Code

jabgui/build.gradle.kts[R118-121]

+            // Target-speccific options
+            "--linux-menu-group", "Office",
            // "--linux-rpm-license-type", "MIT", // We currently package for Ubuntu only, which uses deb, not rpm
-            "--description", "JabRef is an open source bibliography reference manager. Simplifies reference management and literature organization for academic researchers by leveraging BibTeX, native file format for LaTeX.",
-            "--icon", "$projectDir/src/main/resources/icons/JabRef-linux-icon-64.png",
-            "--linux-shortcut",
-            "--file-associations", "$projectDir/buildres/linux/bibtexAssociations.properties"
+            "--linux-shortcut"
Evidence
The Linux packaging config provides Office without a semicolon, and the jpackage .desktop
template does not add a semicolon around the placeholder. In contrast, the Flatpak and Snap desktop
files in this repo use Categories=Office;, indicating the expected formatting within this project.

jabgui/build.gradle.kts[118-121]
jabgui/buildres/linux/JabRef.desktop[8-10]
flatpak/org.jabref.jabref.desktop[9-12]
snap/gui/jabref.desktop[9-12]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Linux desktop category formatting may become inconsistent (`Office` vs `Office;`), potentially affecting menu categorization.

### Issue Context
The jpackage desktop template uses `Categories=DEPLOY_BUNDLE_CATEGORY` and the Gradle config provides `--linux-menu-group`.

### Fix Focus Areas
- jabgui/build.gradle.kts[118-121]
- jabgui/buildres/linux/JabRef.desktop[8-10]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
6. Invalid .desktop placeholder line 🐞 Bug ⛯ Reliability
Description
The Linux .desktop template now contains a bare STARTUP_DIRECTORY line without a key=value
format. If not substituted by the packaging tool, the generated .desktop file will contain an
invalid line and may be rejected or partially ignored.
Code

jabgui/buildres/linux/JabRef.desktop[R4-6]

Exec=APPLICATION_LAUNCHER
+STARTUP_DIRECTORY
Icon=APPLICATION_ICON
Evidence
Unlike the other lines in the desktop entry, STARTUP_DIRECTORY is not a key=value entry. The
repo’s other desktop files do not include such bare lines, so leaving it unsubstituted would be a
new malformed construct in the generated desktop file.

jabgui/buildres/linux/JabRef.desktop[4-6]
flatpak/org.jabref.jabref.desktop[1-12]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`STARTUP_DIRECTORY` is a bare line in the Linux `.desktop` template; if left unsubstituted it will make the file syntactically invalid.

### Issue Context
Other `.desktop` files in the repo use only `key=value` lines.

### Fix Focus Areas
- jabgui/buildres/linux/JabRef.desktop[4-6]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment thread jabgui/build.gradle.kts
// Generic options, but different for each target
"--icon", "$projectDir\\buildres\\windows\\JabRef.ico",
"--file-associations", "$projectDir\\buildres\\windows\\bibtexAssociations.properties",
// "--resource-dir", layout.projectDirectory.dir("buildres").dir("windows").asFile.absolutePath,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Commented-out --resource-dir option 📘 Rule violation ✓ Correctness

New commented-out code was introduced in the Gradle build script, increasing noise and encouraging
dead/uncertain configuration to accumulate.
Agent Prompt
## Issue description
A commented-out configuration line (`--resource-dir`) was added to the Gradle build script.

## Issue Context
The project guideline prohibits commented-out code to avoid dead code accumulation and review noise.

## Fix Focus Areas
- jabgui/build.gradle.kts[87-87]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread jabgui/build.gradle.kts
Comment on lines 103 to +116
targetsWithOs("linux") {
jpackageResources = layout.projectDirectory.dir("buildres").dir("linux")
appImageOptions.addAll(
// Generic options, but different for each target
"--icon", "$projectDir/buildres/linux/JabRef.png",
)
options.addAll(
"--linux-menu-group", "Office;",
// Needs to be listed everyhwere, because of https://github.com/gradlex-org/java-module-packaging/issues/104
"--license-file", "$projectDir/buildres/LICENSE_with_Privacy.md",

// Generic options, but different for each target
"--icon", "$projectDir/buildres/linux/JabRef.png",
"--file-associations", "$projectDir/buildres/linux/bibtexAssociations.properties",
"--resource-dir", layout.projectDirectory.dir("buildres").dir("linux").asFile.absolutePath,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Duplicate resource dir config 🐞 Bug ⛯ Reliability

Linux and macOS packaging set both jpackageResources and pass an explicit --resource-dir option.
If the plugin already maps jpackageResources to --resource-dir, the resulting jpackage
invocation can be ambiguous or fail due to duplicate flags.
Agent Prompt
### Issue description
Linux and macOS targets configure the jpackage resources directory twice (DSL + explicit `--resource-dir`). This can lead to duplicated CLI args or unclear precedence.

### Issue Context
The `javaModulePackaging` DSL already has `jpackageResources`; adding `--resource-dir` manually is likely redundant and risky.

### Fix Focus Areas
- jabgui/build.gradle.kts[103-122]
- jabgui/build.gradle.kts[128-146]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Siedlerchr added a commit that referenced this pull request Feb 22, 2026
…anner

* upstream/tryToFixBanner: (194 commits)
  Enable loading of main.wxs
  Fix icon on Linux (#15188)
  chore(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.5.5 (#15178)
  New Crowdin updates (#15173)
  Reduce complexity in dependencies setup (#15169)
  Start new development cycle
  snapcraft
  snapcraft
  use snapctl
  update metadata fiels
  try with  mesa candidate
  fix snapcraft and skmanrc to use correct version
  Release v6.0-alpha.5
  chore(sbom): update CycloneDX SBOM files (#15172)
  Chore(deps): Bump jablib/src/main/resources/csl-styles (#15171)
  Added "DOI" and URL to entry preview [#14193] (#15121)
  Fix condition to check running CI in workflow
  Add maintainer permission check to workflow
  Add debug output for running checks
  Fix matrix
  ...
@github-actions

Copy link
Copy Markdown
Contributor

The build of this PR is available at https://builds.jabref.org/pull-15188/.

@Doc73

Doc73 commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

I'm sorry, but the build at https://builds.jabref.org/pull-15188/ doesn't add a launcher or an icon to the system.

Siedlerchr added a commit to LoayTarek5/jabref that referenced this pull request Feb 23, 2026
…les-wizard-12709

* upstream/main: (106 commits)
  Merge common gating parts into composite action (JabRef#15197)
  Support protected institutional authors in PersonNamesChecker (JabRef#15175)
  adapt wix (JabRef#14969)
  Improve CI (JabRef#15189)
  Revert "Reduce complexity in dependencies setup (JabRef#15169)" (JabRef#15191)
  Fix compilation
  Fix heylogs test
  Fix icon on Linux (JabRef#15188)
  chore(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.5.5 (JabRef#15178)
  New Crowdin updates (JabRef#15173)
  Reduce complexity in dependencies setup (JabRef#15169)
  Start new development cycle
  snapcraft
  snapcraft
  use snapctl
  update metadata fiels
  try with  mesa candidate
  fix snapcraft and skmanrc to use correct version
  Release v6.0-alpha.5
  chore(sbom): update CycloneDX SBOM files (JabRef#15172)
  ...
RakockiW pushed a commit to RakockiW/jabref that referenced this pull request Mar 1, 2026
* Reorder to match the official JDK .template ordering

* Try to enable correct resources

* Include global options at each target

* Add word to dictionary

* Refine jpackage.md

* Streamline options

* Add --resource-dir

* Remove --resource-dir for Windows

* Use backslashes on Windows

* Remove ; for linux-menu-group

* Do not pass resource dir to windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: binaries Binary builds should be uploaded to builds.jabref.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JabRef v6.0-alpha.5: missing icon in Linux

3 participants