The Epic Mac Bundle features 8 apps to enrich your Mac experience, ranging from productivity to system diagnostics apps. For example, Command-Tab Plus is a simple tool that helps you easily switch.
- Macos App Bundle Structure Builder
- Macos App Bundle Structure Checker
- Macos App Bundle Structure Definition
- Macos App Download
- Macos App Bundle Structure Builder
I occasionally need to help one of our customers get the bundle identifier for a given app, for some purpose with one of our apps. While the task isn't complicated—the value is stored in a file named Info.plist within each app bundle—it's not something that's necessarily easy to explain to someone who doesn't have a lot of Mac experience.
- Creating Mac OS X App Bundle for Java Applications. Java support in Mac OS X isn't perfect but it is better than other operating systems, Apple supplies an application called Jar Bundler, that can wrap your jar files into native Mac OS X App bundles, that are pretty much indistinguishable from native applications.
- MacOS applications are typically distributed in a.app application bundle. To make.NET Core and Avalonia projects work in a.app bundle, some extra legwork has to be done after your application has gone through the publishing process. With Avalonia, you'll have a.app folder structure that looks like this.
I figured there must be a less-complicated solution, and I was right, though it's probably higher on the geek factor. After some searching, I found this thread at Super User, which offers a number of solutions. The simplest—and always working, in my experience—was the very first one: Open Terminal and run this command:
The 'Name of App' is replaced with the name of the app as it appears when hovering over its Dock icon. For Excel, for example, it'd be:
Run that command, and it returns com.microsoft.Excel, which is just what I need—I just have the customer copy the output and email it back to me.
Related Posts:
2020腾讯云双十一活动,全年最低!!!(领取3500元代金券),
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1074
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1074
【阿里云】双十一活动,全年抄底价,限时3天!(老用户也有),
入口地址:https://www.aliyun.com/1111/home
入口地址:https://www.aliyun.com/1111/home
I am trying to bundle my Java application to an Mac OS X .app bundle. I am currently using appbundler and I followed Oracle's guide. The Ant task works fine in Netbeans and the corresponding .app package is built correctly (on Windows). But when trying to execute the .app package to my MacBookPro (OS X 10.7.5), I get the following error in the log:
I already checked the permissions for the .jar file and the execution bits are set for the main-jar and all the jars in the lib-folder.
How to use notebook app for mac and ipad. The application just runs fine when typing the following to the terminal:
For clarification, here's the final folder structure:
By the way, my application has lots of external dependencies, all located in the 'lib' folder which are properly linked by the class-path property within the MANIFEST.MF file of the executable main-jar file 'LawSuiteSE.jar'. Best mac store apps. Do I need to copy these libs within the appbundle-ant-task or is it okay to copy them subsequently by hand?
I also tried to build the application and the corresponding .app package on the MacBook Pro, but the same error message.
Here's my Ant-task:
EDIT: I meanwhile replaced the JavaAppLauncher in Contents/MacOS with a small run script (start.sh):
Then I also replaced the value for the key CFBundleExecutable in Info.plist from JavaAppLauncher to start.sh.
Now it works fine, but how can I use a relative path to the jar-executable? Something like './Java/LawSuiteSE.jar' doesn't work and gives me the same error as before. Is there any constant pointing to the current app-folder, something like '$APP_ROOT' so that the script could look like:
Recommend:osx - Packaging C binary in Mac OS X Application Bundle
ehavior with the result. My bundle has this minimal structure: $ ls -R HelloWorld.appContentsHelloWorld.app/Contents:Info.plist MacOS PkgInfoHelloWorld.app/Contents/MacOS:helloworld helloworld is a C binary compiled from: #incl
Macos App Bundle Structure Builder
Any ideas?
javaosxantbuildjarbundler|
this questionedited Aug 15 '14 at 14:12 asked Aug 14 '14 at 14:01 salocinx 1,053 4 26 65 Are the symlinks working? Generally, when building on windows, the symlinks are broken. – nbz Aug 14 '14 at 14:04 Okay I checked and updated my symlinks on the MacBook Pro by following this guide: monkehworks.com/…. But I does still not work. Next I will try to build my app on the MacBook. – salocinx Aug 14 '14 at 14:32 Building the entire project and bundling the package on the Mac did not help.. still same problem. – salocinx Aug 14 '14 at 14:54 |
1 Answers
1
---Accepted---Accepted---Accepted---Macos App Bundle Structure Checker
Do I need to copy these libs within the appbundle-ant-task
Yes, you should mention all the required libraries in
classpath
elements. The bundler will then copy them all to the appropriate place inside the bundle (only JAR files that are directly under Contents/Java
will go onto the classpath when the bundle is run, JARs in subdirectories are ignored). You should also use dots instead of slashes in the mainclassname.Edit
Now it works fine, but how can I use a relative path to the jar-executable
You can use
dirname $0
to get the path to your bundle's Contents/MacOS
, and take a relative path from there. You should probably also make an explicit reference to the public JRE rather than relying on java
being on your PATH, as that will only work if the target machine has a JDK installed, not if it only has a JRE. Installing the JDK will install the public JRE as well, so it's safe in that case too.|
this answeredited Aug 15 '14 at 14:18 answered Aug 14 '14 at 15:34 Ian Roberts 91.2k 6 104 123 Hi Ian, thanks for your suggestion. Now the bundler copies and flattens all the .jar files within my lib folder to Contents/Java. I also adjusted my MANIFEST.MF to directly looking for the .jars in the app-root folder instead of app-root/lib. But still the very same problem. Btw. is there really no way to keep up the folder structure within the lib-folder? My external libs have themselves heavy dependencies to a lot of other jar-libs in a clearly defined folder structure within the lib-folder. Thanks in advance! – salocinx Aug 15 '14 at 10:06 @salocinx The native launcher stub inserted into the bundle by the bundler task creates it's classpath by enumerating all the jar files that are contained in the
Contents/Java
directory (and only that directory, no subdirs), and executes the mainclassname - this behaviour is hard coded in the stub and is not negotiable. – Ian Roberts Aug 15 '14 at 10:13 Thanks for the quick answer Ian. Okay these are bad news. Is there any work-around to launch my application with some kind of a script or something similar out of an .app-bundle? My application basically works just fine on the Mac when directly launching with 'java -jar Servitus.jar --installer', but I'm really interested in an .app-bundle.. :-) Any further ideas? – salocinx Aug 15 '14 at 11:00 @salocinx you can certainly construct a bundle by hand, and the main 'binary' in Contents/MacOS
Macos App Bundle Structure Definition
can be a shell script that delegates to/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
. This is the approach I use for GATE, though it's a bit more complex in that case as there's a second level of indirection (it's a cross-platform tool, the script inside the .app
Macos App Download
bundle delegates to another shell script, which other platforms would call directly). – Ian Roberts Aug 15 '14 at 11:28 Hi Ian, that's exactly what I meant. Meanwhile I wrote a small start.sh script and linked it with the CFBundleExecutable key in the Info.plist. The only problem remaining is that I need to provide the full path to the .jar-executable within the script, with relative paths it doesn't work.. is there a placeholder that points to the current .app-folder like $APP_ROOT or something similar? Please have a look on the original question above, I added an 'EDIT' section to describe the problem in more detail. – salocinx Aug 15 '14 at 14:14 | show more commentsMacos App Bundle Structure Builder
Recommend:osx - How to print stack trace from Java Mac Os X Application Bundlendle that I build crashes on launch. I want to print a stack trace so I can figure out what is causing the problem. I think this should be pretty straight forward but I can't find an example of this anywhere (maybe my terminology is incorre
Recommend:osx - How to print stack trace from Java Mac Os X Application Bundle
ndle that I build crashes on launch. I want to print a stack trace so I can figure out what is causing the problem. I think this should be pretty straight forward but I can't find an example of this anywhere (maybe my terminology is incorre