-
Bug
-
Resolution: Unresolved
-
P4
-
17, 21
-
x86_64
-
os_x
ADDITIONAL SYSTEM INFORMATION :
OS: macOS BigSur 11.7 (20G817)
JDK: OpenJDK 21 Early-Access Build 4 (but also tested for OpenJDK 17, 19, and 20 EA Build 30)
A DESCRIPTION OF THE PROBLEM :
Calling Taskbar::setProgressValue shows an OS-provided progress bar on top of the app's icon in the dock. This works as expected. However, when packaging the app into a macOS application bundle using jpackage, the progress bar is not shown. See the steps to reproduce and attached source code for details.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Put the attached code into Main.java. Compile the program and create an application image via jpackage:
javac Main.java
jar cf app/main.jar Main.class
jlink --add-modules java.desktop --output rt/
jpackage --type app-image --runtime-image rt/ --input app/ --main-jar main.jar --main-class Main
Run Main.app.
To isolate the cause of the issue, further notice that:
- When running Main.class using the runtime produced by jlink, the bug does not occur.
- When running the executable at Main.app/Contents/MacOS/Main, the bug occurs.
Hence, the binary produced by jpackage appears to cause the problem.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A half-completed progress bar should appear on top of the app's icon in the dock.
ACTUAL -
No progress bar appears.
---------- BEGIN SOURCE ----------
import java.awt.*;
public class Main {
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
new Frame().setVisible(true);
Taskbar.getTaskbar().setProgressValue(50);
});
}
}
---------- END SOURCE ----------
FREQUENCY : always
OS: macOS BigSur 11.7 (20G817)
JDK: OpenJDK 21 Early-Access Build 4 (but also tested for OpenJDK 17, 19, and 20 EA Build 30)
A DESCRIPTION OF THE PROBLEM :
Calling Taskbar::setProgressValue shows an OS-provided progress bar on top of the app's icon in the dock. This works as expected. However, when packaging the app into a macOS application bundle using jpackage, the progress bar is not shown. See the steps to reproduce and attached source code for details.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Put the attached code into Main.java. Compile the program and create an application image via jpackage:
javac Main.java
jar cf app/main.jar Main.class
jlink --add-modules java.desktop --output rt/
jpackage --type app-image --runtime-image rt/ --input app/ --main-jar main.jar --main-class Main
Run Main.app.
To isolate the cause of the issue, further notice that:
- When running Main.class using the runtime produced by jlink, the bug does not occur.
- When running the executable at Main.app/Contents/MacOS/Main, the bug occurs.
Hence, the binary produced by jpackage appears to cause the problem.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A half-completed progress bar should appear on top of the app's icon in the dock.
ACTUAL -
No progress bar appears.
---------- BEGIN SOURCE ----------
import java.awt.*;
public class Main {
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
new Frame().setVisible(true);
Taskbar.getTaskbar().setProgressValue(50);
});
}
}
---------- END SOURCE ----------
FREQUENCY : always