Setting Up a MacBook Pro (Mac OS X High Sierra) for Java and Azure Cloud Development
A view of my onboarding meeting at Microsoft earlier this year.

Setting Up a MacBook Pro (Mac OS X High Sierra) for Java and Azure Cloud Development

Note: this article is a fragment of the original article about my new job at Microsoft.

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 powerful 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 development 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 development 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:

  1. Config Touch Bar to show either Expanded Control Strip or F1…F12 keys
  2. Disable Power Nap
  3. In Accessibility > Display, mark Reduce Motion and Increase Contrast
  4. Leave keyboard brightness to a minimum setting (off if enough ambient light)
  5. 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!

Jakub Ne?et?il

Startup Founder, Non-Profit Founder, Tech Geek, Dad

6 年

Dude - you’re still running High Sierra??

Dennis H.

Data Engineer | Snowflake | DBT | Business outcomes

6 年

Just in Time - needed this tutorial!

要查看或添加评论,请登录

Bruno Borges的更多文章

社区洞察

其他会员也浏览了