I wrote earlier about how to use the
javapackager command to create a macOS application bundle from a Java application, so I won’t repeat all of that information here. Instead, in this article I just want to show how to display an image that’s stored in the Contents/Resources/Java directory of a Mac/Java application bundle.
If you’re interested in packaging Java applications on macOS, this is a good `javapackager` video on YouTube.
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.
I recently learned how to use the Java javapackager command to build a macOS application bundle — i.e., a regular macOS application — from a Java application. In this tutorial I’ll show how to create a Mac application bundle from a simple Java class, in this case a Java Swing class.
As I learned recently, the Mac/Java AppBundler tool is a little out of date these days, but you can still use it with Java 8 and MacOS 10.12 to build Mac/Java applications. One problem you can run into is getting this ugly Info.plist error:
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:
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.”
The new scala-lang.org docs website looks great. It’s also a reminder to me that I probably didn’t stress enough in the Scala Cookbook that everything in Scala is an object, including numbers. (Hopefully I made it clear that functions are objects.) This Scala REPL example shows some of the methods that are available on Scala integers (
I just started working with the Android Room database persistence library, and since you’re not supposed to run things like database queries on the main thread (the UI thread), I was looking at other ways to run them.
In general, you probably won’t want to run database queries using a
Thread, but just to see how Room works, I wrote this Java Thread code, and confirmed that it works as expected: