A bit of background here before we start, because to me using Mac is a very recent event.

If you like this article, please clap for it! Click on the little hands icon to the left or bottom of this page.

I had been a Linux user for over 15 years. Not a specialist/hacker kind of thing — just a user of Linux on the desktop (Ubuntu mostly; but also used Slackware and Fedora in the early days).

Why am I using Mac now? Well… Let's go from the beginning.

In January of 2018 I left Oracle after about 5,5 years working in the Product Management organization doing Developer Relations for Java and Cloud — you can see me here at Oracle Code conference keynote in October 2017.

At Oracle, by the time I joined the company in California in 2015(though I had been working for them since 2012 in Brazil), I was given only one laptop option: a Lenovo. Either I'd have Windows, or Linux. I stood with the Tux. Only in late 2017, Oracle started giving MacBooks for the engineering group by default — which is pretty cool.

Left Oracle. Where was I heading to? Canada!

What the heck? Why?

Because I recently joined Microsoft's Cloud Developer Advocacy group, to help the product engineering teams building and enhancing products and services to the taste and standards of the Java audience.

Let's talk quickly about US Visas…

When I was transferred from Oracle Brazil to Oracle USA, I was given what is called the Intracompany Transferee Visa, aka L-1B type. This visa has a restriction: you are bond to that company until you get either a permantent resident card (green card), or you change status to an H1 type visa. Given my short stay in the US, neither processes completed in time.

So, in my conversations with the Microsoft Immigration team, we found that the best solution would be to move to Canada, where I'd be close to Redmond — and in the same timezone.

Just one minor detail: Canada also issues a Work Permit bond to the company you are going to work for, if that is the case during the visa application. My wife on the other hand received a Work Permit that allows her to work pretty much for any company and almost any area, but that thanks to the relationship with me. Visa approval arrived in 2 weeks. Passport stamps plus 2 weeks. Pretty fast in this case, but if you want you can apply without a "sponsor". It will likely take more time to be approved — if it gets approved (although in most cases, it does).

Done already with the background story… let's get to the business!

Setting up a MacBook for Java and Azure Development

At Microsoft I was given two options: either I’d get a Mac, or a Windows laptop. And given the similarities (in the terminal) between Mac and Linux, I chose the former. And as I said before, I do know how to exit vim.

First of all, you will need a decent terminal. No developer should rely solely on mouse and windows, so a powerfull command-line interface is a must!

This is one article I found that helped me set up my iTerm2. Walkthrough it.

Besides the terminal, by following the article above you also get Homebrew, the missing package manager for Mac.

Install Cask

Cask is a complementary tool for Homebrew that extends to other capabilities such as installing common desktop applications distributed as DMG files somewhere on the Internet, but that are not available on Homebrew directly.

$ brew update

$ brew install cask

$ brew tap caskroom/versions

The next step is to install some basic tools for Java development.

Oracle Java Development Kit (JDK)

Although Java 9 is available, many of my projects are quite still on Java 8. Some of them need changes in Maven POM files, and I just want to get them up and running. So that is why I am sticking to java8 below, but feel free to just say java, and cask will pick the latest (9).

It is also a good idea to always check the package version on Cask and compare with the latest on the website of the tool. Use info for that.

$ brew cask search java

$ brew cask info java8

java8: 1.8.0_162-b12,0da788060d494f5095bf8624735fa2f1

...

$ brew cask install java8

NetBeans IDE

$ brew cask info netbeans-java-ee

netbeans-java-ee: 8.2

...

$ brew cask install netbeans-java-ee

IntelliJ IDEA

$ brew cask info intellij-idea-ce

intellij-idea-ce: 2017.3.4,173.4548.28

...

$ brew cask install intellij-idea-ce

Visual Studio Code

$ brew cask info visual-studio-code

visual-studio-code: 1.20.0,c63189deaa8e620f650cc28792b8f5f3363f2c5b

…

$ brew cask install visual-studio-code

Now… if you really want, you can also install Eclipse through Cask…And I will leave it to you :-)

More tools!

These should give you enough to get started, but in the real world, you will need more. A lot more!

Java Build Tools — Maven, Gradle, Ant

$ brew install maven gradle ant

Java Scaffolding Frameworks — JHipster, Spring Roo, JBoss Forge

$ brew install jhipster spring-roo jboss-forge

Javascript Tools — Angular CLI, Node.js

$ brew install node angular-cli

Quite frankly, if you know any other important tool for Javascript development, please let me know.

Other tools — Wireshark, HTop, Git, Slack, GitHub Desktop, Spotify, Microsoft Azure Storage Explorer

$ brew install wireshark htop git

$ brew cask install wireshark slack github dotnet dotnet-sdk spotify microsoft-azure-storage-explorer

The reason I installed Wireshark twice, one with cask, was to get the GUI.

Now let's get into more sys admin, DevOps, runtime tools…

VMs and Containers — VirtualBox, Docker, Kitematic, Vagrant, Terraform, Minikube

$ brew cask install docker kitematic virtualbox vagrant minikube

$ brew install terraform

The Docker package available on Homebrew is just the CLI. If you install with Cask, you get the fully featured Docker for Mac. I strongly recommend you get this one. Lastly, Terraform migrated from Cask to Homebrew/Core, so that's why.

Docker also has an Edge version that includes Kubernetes out of the box. If you prefer that, don't install minikube (because you won't need it), and instead install the package docker-edge. Personally, I prefer Docker (stable version) and Minikube.

Serverless Platforms — Azure Functions, OpenFaaS, Fn Project

$ brew install azure-cli faas-cli fn

$ npm install -g azure-functions-core-tools@core

The Azure CLI is a key element for development with Azure services. Almost all Azure services are accessed through this single CLI, so keep it installed!

Relational Databases — MySQL, PostgreSQL, Microsoft SQL Server, Oracle Database

This one is tricky. In the past I used to have MySQL installed and that's it. Most of the time I'd start MySQL daemon, create a database and grant a new user entire permission, and then use that in my application.

These days, I think that for develompent purposes, all developers should be using databases inside Docker containers. But only for development/testing. I am still not so sure about RDBMS on Docker in production.

Now, what you really need to have are the Client CLIs for these databases. So let's install them!

$ sudo easy_install pip

$ sudo pip install --upgrade pip

$ sudo pip install mssql-cli

$ brew install postgres

$ brew cask install mysql-shell

Sadly, the new Oracle Database CLI — sqlcl — does not provide an easy install method. You will have to go to its download page and take it from there. Good luck.

The part about running databases locally for develoment purposes on Mac will come in a future post.

Other databases — none, because I'd rather stick with good old fashion SQL :-)

Power/energy saving settings: getting the most out of the battery!

One thing I noticed initially was that the battery of this Mac wasn't lasting long enough. I was barely getting 2 hours straight.

So I dug the internet for tweaks. Here are they:

Config Touch Bar to show either Expanded Control Strip or F1…F12 keys Disable Power Nap In Accessibility > Display, mark Reduce Motion and Increase Contrast Leave keyboard brightness to a minimum setting (off if enough ambient light) Disable iCloud > Keychain if you don't need it

So that's it! If you know any other tool that you believe is extremely important for a Java developer to have on its Mac, please comment below!

Cheers!