Apple Silicon M1 for Software Development: Java, C++ with Qt

Apple’s laptops have been making quite the splash since the end of 2020 and have made a massive comeback as a professional tool one year later with the M1 Pro and Max designs. Most of the reviews I have seen focus on the editing and rendering capabilities of these new MacBooks. A few reviewers throw a compile test in the mix, but compiling Chromium or any other huge project is only a part of the equation. Developers don’t just compile code; they also use tools and IDEs to develop their software.

Being new to the M1 world, I wanted to recap my experiences so far briefly. I use Java professionally, and I also have a C++ application based on the Qt framework that I wrote an eon ago and still use productively. Being a former C++ professional, I am about native performance, and I like native software. Therefore, I intended to utilize as many Apple Silicon-native tools as possible. Luckily, one year after its release to the desktop world, the most popular applications have caught up. Let me go through my tool suite one by one.

General Purpose Code Editor

This application should not be a surprise to anyone, and I think I can move on quickly. Microsoft’s Visual Studio Code has quickly established itself as everybody’s darling since its inception. Although it is based on Electron, it is fast and a joy to work with. As far as Electron goes, it runs natively on M1 Macs.

Picture showing Visual Studio Code in macOS Activity Monitor running Apple Silicon native.

Java

Java is definitely the last thing you might think about when discussing “native” applications. Be that as it may, it is actually a decent language in which you can be very productive. Now, I do not want to discuss the pros and cons of Java. I just thought a little stab at “native” was warranted. Moving on…

It is essential to choose the correct JDK to get an M1-native Java SDK. I went with Adoptium first because it is the successor to AdoptOpenJDK, which I use on Windows. To my surprise, when I started the installation procedure, macOS asked me to install Rosetta first. I politely declined, quickly searched the interwebs, and found that Oracle provides Apple Silicon ARM versions.

Picture showing Java jshell in in a Terminal in macOS Activity Monitor running Apple Silicon native.

The next step is an IDE, and I do not use VS Code for that. Although it is very capable, I am also very used to how Jetbrains’ IntelliJ IDEA works. Since I want to be productive, I am not interested in learning Visual Studio Code for Java. Unfortunately, the download page does not correctly detect the M1 platform and defaults to the Intel version. You must select the correct download yourself.

Picture showing how to download Apple Silicon version of IntelliJ IDEA.

When you have downloaded the correct file, you will get a native IDE experience.

Picture showing IntelliJ IDEA in macOS Activity Monitor running Apple Silicon native.

I also installed Apache Maven, and since it is a Java application, it runs on the native Java that I have installed. So far, so good.

C++

Writing M1-native C++ should not be a problem with Apple’s Xcode – at least, I would assume so. The Qt framework is more important to me because I have used it in the past for work, and I have also developed a little utility to track the time spent on tasks at work. Starting with version 6.2, Qt fully supports Apple Silicon (scroll to section “new Platforms”), which made me hopeful. Is was surprised, though, when the installer prompted macOS to throw Rosetta in my face. I first tried to see if I downloaded the wrong version, but I could not find any other. Begrudgingly I went ahead and finally installed Rosetta because I now was even more curious how this “M1 support” looked. The installation works just like I outlined in this blog post for Linux Mint. When selecting the Qt libraries to install, I naturally went with the “macOS” versions.

Picture showing Qt installer on macOS running Intel code in Rosetta.

As you can see, the options are limited. Activity Monitor also shows how Rosetta is used to running the installer utility. The same is true for Qt Creator, which made me a bit nervous.

Picture showing Qt Creator in macOS Activity Monitor running emulated Intel with Rosetta.

My application compiled out of the box, and it was quick, too. It is but a small utility, so I did not expect a long compilation anyway. Interestingly enough, my application also runs out of the box, and, alas, it is Apple Silicon native.

Picture showing custom Qt application in macOS Activity Monitor running Apple Silicon native.

Unfortunately, not everything is working, but I have never developed this application on any Apple operating system. I have tailored it to work with Windows, and it should also work on Linux for the most part. Be that as it may, the bundled Qt libraries seem to be native for M1 Macs even though the IDE itself isn’t yet.

Closing Thoughts

I have only had my MacBook Air for about a week now, and other than installing applications and performing a short functional test, I am yet to do any “serious” hobby work. So far, I am happy with the results. Of course, I’d like the whole Qt suite to be Apple native. More important to me is that I can say that my application is native for M1 Macs – whenever I get around to optimizing it 😅.

I am also interested in trying out Microsoft’s Visual Studio for Mac, .NET 6, and the MAUI SDK for cross-platform development. It goes against my need for native compilation, but using C# also increases productivity compared to C++. It has been a while for me since I last did any noteworthy C++ development, and I am quite a bit rusty. For now, I am content, and I have everything running that I need.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.