My FeedDiscussionsHashnode Enterprise
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Slow Java / Kotlin compile times on OSX Sierra ?

Slow Java / Kotlin compile times on OSX Sierra ?

Jan Vladimir Mostert's photo
Jan Vladimir Mostert
·Apr 21, 2017

When you create your first Kotlin "Hello World" and it takes 20+ seconds to run, I can imagine plenty of negative first impressions.

fun main(args: Array<String>) {

This is what I'm getting on Linux on a dual core machine with 8GB of RAM which I think is reasonable:

And this is what it does on OSX Sierra on a quad core machine with 16GB of RAM:

Logged a ticket here:

After some help from the Kotlin guys on Slack, it was resolved and compile times went down from around 20 seconds to around 2 seconds.


When you open your terminal, what does it say in front of the dollar sign?

vlad:src grim$

Now open your /etc/hosts file:    localhost    broadcasthost 
::1             localhost

Apparently on the new OSX Sierra, compiling Java / Kotlin tries to resolve vlad.local or grim.local which takes very long to resolve.

Let's add it to the hosts file:   localhost vlad.local grim.local    broadcasthost 
::1         localhost vlad.local grim.local

Restart your network interface:

sudo ifconfig en0 down 
sudo ifconfig en0 up

... and your compile times should drop to reasonable levels.

Huge thanks to everyone who helped on Slack and to Sébastien Deleuze for sharing this article: and that article for mentioning this StackOverflow post:…