M Markos Well-Known Member Licensed User Longtime User Apr 18, 2020 #1 Hi All, I researched for hours and still no solution how to hide or remove the Java icon from appearing when running a Java based App on the mac.. There are several solutions proposed online none of which works for me I'm using JDK11.x on Catalina Mac OSX The most common proposed solution is to set the system property apple.awt.UIElement=true I've tried it via a VM argument as java -jar -Dapple.awt.UIElement=true javaname.jar (and alternativelyapple.awt.UIElement="true") also SetSystemProperty("apple.awt.UIElement", "true") in B4J at the beginning of AppStart and still the Java appears in the Dock. Other suggestions to try apple.awt.headless=true or java.awt.headless=true with no luck. Has anyone found a solution for this challenge? More Info: My App uses JavaFX components and it seems JavaFX currently doesnt support Dock Icon Less capability. Having said that is their a work around I can do in either B4J code or in the scripts calling the Jar to not have the Java Coffee icon appear in the dock alongside my running App Icon. Last edited: Apr 18, 2020
Hi All, I researched for hours and still no solution how to hide or remove the Java icon from appearing when running a Java based App on the mac.. There are several solutions proposed online none of which works for me I'm using JDK11.x on Catalina Mac OSX The most common proposed solution is to set the system property apple.awt.UIElement=true I've tried it via a VM argument as java -jar -Dapple.awt.UIElement=true javaname.jar (and alternativelyapple.awt.UIElement="true") also SetSystemProperty("apple.awt.UIElement", "true") in B4J at the beginning of AppStart and still the Java appears in the Dock. Other suggestions to try apple.awt.headless=true or java.awt.headless=true with no luck. Has anyone found a solution for this challenge? More Info: My App uses JavaFX components and it seems JavaFX currently doesnt support Dock Icon Less capability. Having said that is their a work around I can do in either B4J code or in the scripts calling the Jar to not have the Java Coffee icon appear in the dock alongside my running App Icon.
M Markos Well-Known Member Licensed User Longtime User Apr 25, 2020 #21 Hi Erel Below seems to do the trick but relies on inclusion in the main.java block where it calls the javafx application. B4X: Copy public class AppAwt { public static void main(String[] args) throws Exception { System.setProperty("apple.awt.UIElement", "true"); java.awt.Toolkit.getDefaultToolkit(); TestTrayJavaFX.main(args); } } I think and will stand corrected by you as needed, the relevant lines to include are B4X: Copy System.setProperty("apple.awt.UIElement", "true"); java.awt.Toolkit.getDefaultToolkit(); If you can include in a sample javafx app built to jar and I will test. If works perhaps we can be empowered to alter or include code in the main block of main.java inside B4J. Last edited: Apr 25, 2020 Upvote 0
Hi Erel Below seems to do the trick but relies on inclusion in the main.java block where it calls the javafx application. B4X: Copy public class AppAwt { public static void main(String[] args) throws Exception { System.setProperty("apple.awt.UIElement", "true"); java.awt.Toolkit.getDefaultToolkit(); TestTrayJavaFX.main(args); } } I think and will stand corrected by you as needed, the relevant lines to include are B4X: Copy System.setProperty("apple.awt.UIElement", "true"); java.awt.Toolkit.getDefaultToolkit(); If you can include in a sample javafx app built to jar and I will test. If works perhaps we can be empowered to alter or include code in the main block of main.java inside B4J.
Erel B4X founder Staff member Licensed User Longtime User Apr 26, 2020 #22 This thread becomes too long to be useful. Do I understand correctly that setting the system property before the app starts is not enough? Upvote 0
This thread becomes too long to be useful. Do I understand correctly that setting the system property before the app starts is not enough?
M Markos Well-Known Member Licensed User Longtime User Apr 26, 2020 #23 Both at Java command and within the B4J appstart code module it does not work. It seems as stated online it is preferred within the main.java to truly achive setting prior to javafx app start Upvote 0
Both at Java command and within the B4J appstart code module it does not work. It seems as stated online it is preferred within the main.java to truly achive setting prior to javafx app start
Erel B4X founder Staff member Licensed User Longtime User Apr 27, 2020 #24 Try this: https://www.b4x.com/android/forum/threads/osx-native-menu.58561/post-368656 Upvote 0
M Markos Well-Known Member Licensed User Longtime User Apr 27, 2020 #25 This appends the menu system from the preferred Application header to the Java menu but does not hide or remove the Java menu or Java/Coffee Dock Upvote 0
This appends the menu system from the preferred Application header to the Java menu but does not hide or remove the Java menu or Java/Coffee Dock
Erel B4X founder Staff member Licensed User Longtime User Apr 27, 2020 #26 It will solve the issue where your app name doesn't appear on the title. Upvote 0
M Markos Well-Known Member Licensed User Longtime User Apr 27, 2020 #27 Erel said: It will solve the issue where your app name doesn't appear on the title. Click to expand... Thanks Erel, That did correct an issue I didnt identify and a nice compliant feature for MacOSX user standards. However That's not my initial store related issue. My issue is to make the App dockless for the Java component/icon. My App Dock icon and Menu is fine, the additional Java Menu and Docked icon is the issue. Below shows the suggestion of how to modify the main.java. However the setting using -Dapple.awt.UIElement=true is not as reliable https://stackoverflow.com/questions...up-icon-from-appearing-in-the-dock-on-mac-osx If this suggestion is illogical then I will have to wait until someone finds a solution online and shares it Thanks for trying, perhaps a few days from now a solution may come to you. Last edited: Apr 27, 2020 Upvote 0
Erel said: It will solve the issue where your app name doesn't appear on the title. Click to expand... Thanks Erel, That did correct an issue I didnt identify and a nice compliant feature for MacOSX user standards. However That's not my initial store related issue. My issue is to make the App dockless for the Java component/icon. My App Dock icon and Menu is fine, the additional Java Menu and Docked icon is the issue. Below shows the suggestion of how to modify the main.java. However the setting using -Dapple.awt.UIElement=true is not as reliable https://stackoverflow.com/questions...up-icon-from-appearing-in-the-dock-on-mac-osx If this suggestion is illogical then I will have to wait until someone finds a solution online and shares it Thanks for trying, perhaps a few days from now a solution may come to you.
M Markos Well-Known Member Licensed User Longtime User Apr 28, 2020 #28 I don't know if the below image supports my theory. When applying the setproperty within B4J Appstart code and running the run.command Upvote 0
I don't know if the below image supports my theory. When applying the setproperty within B4J Appstart code and running the run.command
M Markos Well-Known Member Licensed User Longtime User Apr 30, 2020 #29 Dear Erel, I have tried all methods online, be it swing, awt libraries and they all are useless for Javafx App. It may be attributed to a shortcoming of the the Jdk11+ that we have to live with. The only aspect I couldnt try and that may be a dead end to and that is to make amendments to the main.java to ensure we apply prior to javafx running, but that is only in your control and discretion. What I did as a work around is to hide the App bundle dock and menu and rename the java to my Program name and use -Xdock:icon=iconname to apply my program icon to replace the java coffee icon. There is still the issue of the class name showing up in the sub menu items next to Hide & Quit. I will submit to Mac Apple and see if they will permit despite that discrepency in naming convention Upvote 0
Dear Erel, I have tried all methods online, be it swing, awt libraries and they all are useless for Javafx App. It may be attributed to a shortcoming of the the Jdk11+ that we have to live with. The only aspect I couldnt try and that may be a dead end to and that is to make amendments to the main.java to ensure we apply prior to javafx running, but that is only in your control and discretion. What I did as a work around is to hide the App bundle dock and menu and rename the java to my Program name and use -Xdock:icon=iconname to apply my program icon to replace the java coffee icon. There is still the issue of the class name showing up in the sub menu items next to Hide & Quit. I will submit to Mac Apple and see if they will permit despite that discrepency in naming convention
M Markos Well-Known Member Licensed User Longtime User May 1, 2020 #30 An update. The class name appearing in the sub menu item list is not accepted by Apple. Do we have an alternate solution for -Xdock:name=appname for java command as it is not working and no programmatic solution exists as far as I can see and possibly even if we had access to main.java it may be iffy at best. Upvote 0
An update. The class name appearing in the sub menu item list is not accepted by Apple. Do we have an alternate solution for -Xdock:name=appname for java command as it is not working and no programmatic solution exists as far as I can see and possibly even if we had access to main.java it may be iffy at best.
Erel B4X founder Staff member Licensed User Longtime User May 3, 2020 #31 Please start a new thread. Post Apple response and post a screenshot. Upvote 0