You can achieve this when you bundle your application with jpackage.
For proper macOS menubar handling you should also consider to use
the library NSMenuFX (https://github.com/codecentric/NSMenuFX) because
JavaFX itself still cannot do that.
Michael
Am 17.09.20 um 19:11 schrieb Rob Nikander:
Hi,
I’m trying to set the text shown in the macOS menubar. The advice I see online
says to use -Xdock:name, but when I try that, I still see “java” in the
menubar. Is there a way to make it use “MyAppName”? Some of my
build.gradle.kts file is shown below.
Rob
plugins {
application
kotlin("jvm") version "1.4.10"
id("org.openjfx.javafxplugin") version "0.0.9"
}
application {
mainClass.set(“myapp.MainKt")
applicationName = "MyAppName"
applicationDefaultJvmArgs = listOf(
"-Xdock:name=MyAppName"
)
}
javafx {
version = "15"
modules = listOf("javafx.controls”)
}