This is a good guide for things to be aware of when creating Mac/macOS applications using Java. It mostly includes a lot of information about the com.apple.eawt.AppEvent library/classes.
recent posts related to the mac os x operating system
As a note to self, this apple.com Maintaining Your Signing Identities and Certificates page contains information on signing identities, certificates, provisioning profiles, developer accounts, developer id certficates, the keychain access app, exporting certificates, and more.
If you’re using the Oracle AppBundler to build a Mac/MacOS application bundle from a Java application and run into this error when running Ant:
NoSuchFileException: <directory path here> Info.plist
I have found that the problem is that I have not set and exported
JAVA_HOME. To set and export
JAVA_HOME on MacOS 10.12, I use this command in the shell script I use to build my Mac/Java app:
I was surprised to learn that when you sign a macOS application, the signing process doesn’t sign every file under the .app application directory. Here’s a quote from the Apple developer docs:
“Your app’s executable code is protected by its signature because the signature becomes invalid if any of the executable code in the app bundle changes. Note that resources such as images and nib files aren’t signed; therefore, a change to these files doesn’t invalidate the signature.”
Over the last two days I’ve gotten a Mac/Java app ready for Apple’s Mac App Store, including bundling the application as a macOS “.app” application bundle, and signing it so it can be submitted to the Store.
A relatively quick look at my browser history shows that I needed to hit over 260 URLs to get that done. As a wise professor once told me, “Keep learning, keep learning.”
In this article I assume that you already know at least a little bit about how to use AppleScript, and just want to know how to trigger a MacOS notification. At the end of the tutorial I show how to invoke the AppleScript code using Scala and Java.
If you want to copy the current macOS Terminal path to the clipboard, you can do it with this simple command:
$ pwd | pbcopy
pwd prints the path to STDOUT, and
pbcopy reads that and copies it to the macOS clipboard. Once the path is on the clipboard you can paste it into your other applications.
Of course you can also create an alias, like this:
alias path="pwd | pbcopy"
Note to self: When trying to use Pandoc to create a PDF on MacOS, you need to install MacTex separately. Install everything, because it will make things much easier later.
If you ever need to copy text (or a text file) from the MacOS Terminal to the Mac clipboard, I can confirm that the macOS
pbcopy command works. It reads from STDIN and copies the text to the clipboard, so commands like these work:
$ echo "foo bar baz" | pbcopy $ cat /etc/passwd | pbcopy
As a quick note, I often have a problem where the Messages app on MacOS (formerly Mac OS X) won’t update to receive new messages. By this I mean that I receive messages on my iPhone, but then when I go to my Mac and open the Messages app, my new text messages either never get there, or it takes a long time for them to show up in the Messages app.