I have a Java console application, that opens the System Menu Bar on Mac (the menubar on the top of the screen) when I run java -jar jarfile.jar <args>
. I don't use Swing and I don't have any GUI. Application name in the menubar is just <package>.<mainClass>
, the menu just contains e.g. About, Quit.
Since I call this multiple times when running a script, this is a bit disturbing for me and I want to disable it.
I am using gradle for building and I build the jar like this:
jar {
baseName = 'appname'
from(configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
def commit = "git rev-parse --short HEAD".execute().text.trim()
manifest {
attributes(
'Implementation-Title': 'appname',
'Implementation-Version': '1.0',
'Commit-Id': commit,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Main-Class': mainClassName
)
}
}
dependencies {
compile 'com.lowagie:itext:2.1.3'
compile 'com.itextpdf:itext-hyph-xml:5.1.0'
}
Is this possible? Do you need any other information? Unfortunately I don't know what causes the appearing of the menu bar, so I don't really know what else I should provide.
I created a sample gradle-project: no menu bar, even if I added my dependencies. I also tried setting the property apple.laf.useScreenMenuBar
but that also didn't make any difference for me.