Become a MacRumors Supporter for $25/year with no ads, private forums, and more!
  • Did you order new AirTags? We've opened a dedicated AirTags forum.

iindigo

macrumors 6502a
Original poster
Jul 22, 2002
772
42
San Francisco, CA
First of all, just let me say that I apologize if I misuse any Java terminology. It's not my field of expertise - I'm an Obj-C/Cocoa guy, so some Java stuff gets me completely lost.

I'm trying to make a Java app that I use frequently a little more Mac friendly. Normally, it's just a bare .jar and so lacks many things, such as a proper app name, dock icon, and Mac menubar usage.

I still have a copy of the Jar Bundler included with Xcode 3. The bundles it produces work nicely for the most part, but it has a problem with this particular jar file. For whatever reason, the Use Macintosh Menu Bar option doesn't work. In fact, it's completely ignored, and the app's menus remain attached to its window.

I do not have access to the source.

What could cause the menubar option to fail? Is there anything I can do without first acquiring the source?


P.S. It's no big deal if it's not possible, but is there some way I can force the application to use native (or closer to native) file dialogs instead of the mediocre-at-best standard Java ones?
 

foidulus

macrumors 6502a
Jan 15, 2007
904
1
First of all, just let me say that I apologize if I misuse any Java terminology. It's not my field of expertise - I'm an Obj-C/Cocoa guy, so some Java stuff gets me completely lost.

I'm trying to make a Java app that I use frequently a little more Mac friendly. Normally, it's just a bare .jar and so lacks many things, such as a proper app name, dock icon, and Mac menubar usage.

I still have a copy of the Jar Bundler included with Xcode 3. The bundles it produces work nicely for the most part, but it has a problem with this particular jar file. For whatever reason, the Use Macintosh Menu Bar option doesn't work. In fact, it's completely ignored, and the app's menus remain attached to its window.

I do not have access to the source.

What could cause the menubar option to fail? Is there anything I can do without first acquiring the source?


P.S. It's no big deal if it's not possible, but is there some way I can force the application to use native (or closer to native) file dialogs instead of the mediocre-at-best standard Java ones?

Is the menu bar there when you launch it as a jar? You can set a Java system property that will enable/disable the menu bar at the top of the screen, the default is to put it on the top, but if the coders set that system property then it won't appear there.
 
Comment

thundersteele

macrumors 68030
Oct 19, 2011
2,984
8
Switzerland
Automator can do this.

Open Automator, create a new application, then drag the "run shell script" into the window on the right. In the "run shell script" window, type

java -jar /path/to/app.jar

I'm not sure if something else is needed for java, but this is how I created launch icons for some of the macports I installed.
 
Comment

chown33

Moderator
Staff member
Aug 9, 2009
9,176
5,757
Hellanback
If you told us exactly what the Java app was, and the URL of where to get it, then maybe someone could take a closer look at it.

Without specifics, all anyone can do is guess about why it's not doing what you want.
 
Comment

nehalvpatel

macrumors newbie
Aug 15, 2010
8
0
I ran into a similar problem, and I did this (I'm not sure if that's exactly what you wanted, but here you go!):
Code:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    system("open /Applications/name.jar");
    [NSApp terminate:(0)];
}

All it does is launch the .jar and then quit the current app. :D
 
Comment

foidulus

macrumors 6502a
Jan 15, 2007
904
1
ok, so it's not set in the code then. Try adding this to the <Properties> section of the Info.plist file in the .app directory:


Code:
                <key>Properties</key>
                <dict>
                        <key>apple.laf.useScreenMenuBar</key>
                        <string>true</string>
                </dict>

That will tell the app to use the screen menu bar.
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.