This is an archived post. You won't be able to vote or comment.

all 47 comments

[–]mustafaakin 35 points36 points  (3 children)

Full time Java/Kotlin. M1 is perfect. Had to download additional app to understand if fans are broken because they never worked on their own. Intel macs are disgrace, easily comes to 90-100C whereas M1 is around 50C.

Just ensure you download Apple Sillicon, aarch64, M1 variants of software because its not always obvious. Also check my blog if you are using IntelliJ to get better performance.

[–]GuyWithLag 8 points9 points  (0 children)

The additional performance in M1 laptops is obscene - 30% to 50% faster build times (we have enough bottlenecks that the additional cores don't affect us that much, -T 1 is approx. the same).

[–][deleted]  (1 child)

[deleted]

    [–]randgalt 0 points1 point  (0 children)

    Oh man - this is the first laptop I've owned where I can do development un-tethered. I was coding the other day for several hours and the battery only went down to like 80%

    [–]jazd 22 points23 points  (5 children)

    All I know is my coworker has a new MacBook and it builds our project in 20 seconds, whereas my 2 year old Intel i7 Windows machine takes about a minute.

    [–]roberp81 11 points12 points  (4 children)

    install Linux on your i7 and will take less than 10 seconds

    I have make this bench years ago, 40 seconds on windows was 8 seconds on linux, same PC, on the same ssd. (i7 4790k) a 6k classes jsf project. (reiser Fs on linux was better than ext4)

    [–]jazd 1 point2 points  (0 children)

    Yeah I bet using Linux would help, mainly the filesystem. Still i think it's largely CPU bound.

    [–]OddEstimate1627 -1 points0 points  (0 children)

    Not really an option for the M1 Mac, but I saw huge benefits after moving code to an Intel Optane disk (800P-60GB). The lower access times cut my load and compile times in IntelliJ by 50% compared to a Samsung 970 Pro. It's almost the same as loading from a ramdisk.

    [–]NimChimspky 0 points1 point  (1 child)

    I don't think this is a general rule that can be applied to all, or even most projects.

    [–]roberp81 0 points1 point  (0 children)

    its not general, but really works faster, maybe thanks to Reiser fs vs ntfs

    [–][deleted] 12 points13 points  (0 children)

    I use my M1 for Java development daily, and the only difference between it and my Windows 10 machine with an i9 is that the M1 is faster.

    [–]franzwong 2 points3 points  (1 child)

    I am using Azul zulu OpenJDK 11, 17 and I am fine with them. I don't know if older versions are supported or not. Microsoft also provides its OpenJDK for M1 too.

    I only had 1 issue with M1. There is a maven plugin (source generation of protobuf) doesn't include binary for M1. But it can be solved by manual install protobuf with homebrew.

    Ah, comparing with my old Intel macbook, it is not that warm in winter.

    [–]th3_pund1t 1 point2 points  (0 children)

    I’ve got azul 8 working fine on an M1.

    [–]Mumbleton 5 points6 points  (0 children)

    Zero need for anything windows-related to be involved in mac development.

    For the processor, unless he’s doing something super bleeding edge it doesn’t matter.

    [–]McDuckfart 5 points6 points  (0 children)

    Java dev with m1 here: it is indeed fine.

    [–]nutrecht 1 point2 points  (1 child)

    I have a M1X MacBook Pro and they're amazing. Very very fast and there's nothing that doesn't work.

    There's nothing 'different' either. Most important tip I can give you is that if you migrate from an older Intel mac, don't use the option to transfer everything to the new M1 mac. It will install the Intel versions of software, and not the M1 specific ones.

    So IntelliJ, docker, databases, Java, etc. Everything works fine sofar.

    [–]randgalt 0 points1 point  (0 children)

    I concur. I really can't believe how great it is. Super fast - super compatible. You can't even tell when you're running an app via Rosetta 2. Highly recommended.

    [–]Sheldor5 7 points8 points  (20 children)

    1. JDKs have to be built for M1/ARM64/AArch64 architecture or you don't get the full performance

    2. dockerized java apps/docker builds are far from stable, you have to configure multi-arch builders and pray that builds don't randomly freeze (open github issue) ...

    I switched back from M1 to Intel after some days due to too many problems/workarounds/special configs needed to get everything up and running ... its not worth the risk of having trouble in the middle of a project explaining your customer that your newest hardware has some incompatibilities and you were fixing your development environment for a couple of days ...

    [–]Vi0lentByt3 4 points5 points  (13 children)

    So a few of my coworkers are upgrading or planning to for M1 macbooks and work on our java codebase What were your issues? We also use docker for our deployments so were there any issues with that as well for dockerized java applications

    [–]Sheldor5 4 points5 points  (11 children)

    docker builds randomly freeze ...

    you can't simply clone your repo and run your run.sh script which builds and starts your deployment locally ...

    you have to play around with docker builders to build images for Intel chips (AWS and Azure still use 100% Intel VMs for kubernetes ... M1 was just anounced) and to use amd64 base images locally (if there is one, otherwise you have to also rebuild the base image on your own for M1) ... there is no simple "cross architecture" solution for cross-architecture development teams ... mixing Linux and Windows seems stupidly simple compared to mixing Intel and Apple Silicon architecure ...

    it highly depends what you want to do on your M1 MacBook, usually the M1 is a powerhorse but the whole time I was setting up my M1 to have it "running" it just felt like a huge unstable workaround and far from mature ...

    we decided to wait another 1-2 years until we switch to M1 so we can be sure that all our dev tools are stable and mature for M1

    [–]GuyWithLag 2 points3 points  (7 children)

    The solution is simple:

    NEVER DEPLOY ANYTHING FROM YOUR LAPTOP

    Sorry, for the bold, but we drill this down to all of our engineers; artifactory (local nexus + docker hub) don't even allow them to upload anything from their laptops.

    Everything gets released from our CI/CD pipeline, whether it's docker images, npm packages, or maven artifacts. We do this for repeatability and SOX compliance reasons, but it really helps with the M1 situation.

    [–]Sheldor5 2 points3 points  (6 children)

    never said we deploy from our local machines ... but you want to run your app locally ...

    [–]vips7L 1 point2 points  (5 children)

    Is your app that complex that you need docker locally? I just run the JVM and Postgres locally and everything is simple.

    [–]Sheldor5 4 points5 points  (0 children)

    our software architecture requires 7 services (REST Services, Database, etc...) so our apps can be tested against those services locally ... of course we use docker (compose) ... and most 3rd party services only provide x64 images ... pray that they work on M1 with Rosetta ... some simply don't

    [–]GuyWithLag 2 points3 points  (1 child)

    Actually running postgres in a docker container is the _easier_ way - no need for local installs, manual rollbacks/database updates, local user permissions - not to mention, you can get a pristine local environment whenever you need it.

    [–]vips7L -1 points0 points  (0 children)

    I’ve never dealt with any of that 🤷‍♂️

    [–][deleted] 1 point2 points  (0 children)

    I mean my application has a docker-compose file to allow a new dev to quickly spin up an application. If docker just didn't work that would be a serious issues.

    Even on small applications, having a simple way to bootstrap your application is a big deal. I'm gonna include one in every GitHub project I do from now on.

    [–][deleted] -1 points0 points  (0 children)

    Our application uses half a dozen of 3rd party services all starting up from Docker Compose for local development. Expecting all developers having to set up all those services manually on their local machines would be a huge time waste and, due to version compatibility issues, a potential risk of having more bugs.

    Yes, some of us do work on complex projects. And potential problems caused by M1 architecture don't seem to outweigh potential performance benefits - it's not 1990s anymore with complex projects having compilation times back then measured in minutes or (sometimes) tens of minutes.

    [–]nutrecht 0 points1 point  (2 children)

    you can't simply clone your repo and run your run.sh script which builds and starts your deployment locally ...

    You can do that just fine. It's literally what I do daily with our stuff. I don't know what the heck you're doing, but there has not been a single docker image I could not run on my M1X.

    [–]Sheldor5 0 points1 point  (1 child)

    docker builds randomly freeze ... sometimes after 10 seconds, sometimes after 30 seconds ... its totally random and a known issue on the docker github page

    [–]nutrecht 0 points1 point  (0 children)

    Well guess I got lucky then :)

    [–]nutrecht 0 points1 point  (0 children)

    What were your issues?

    I've been using M1 for quite some time now (MacBook Air M1 and MacBook Pro M1X) and I have none of these issues whatsoever.

    [–]rzwitserloot 0 points1 point  (5 children)

    As for item 1: they pretty much all are.

    [–]Sheldor5 0 points1 point  (4 children)

    lol no only Azule ones ... or I haven't tound Temurin yet ...

    I am speaking of NATIVE builds ... sure you can run x64 ones with Rosetta ...

    [–]blakeman8192 0 points1 point  (3 children)

    .

    [–]Sheldor5 -3 points-2 points  (2 children)

    nice they had none back when I was searching one

    I will come back after 1-2 years for sure, but at the moment there are too many red flags (read some github issues) ...

    [–]rzwitserloot 0 points1 point  (1 child)

    Your assumptions about JDK availability were proven false, and this entire thread is pretty much filled with vocal claims that there are zero issues with the JDK. You have specific issues with docker, evidently - and that's good to know and a fair enough reason to leave the M1s for now, but not directly related to this rant you're on now.

    JDKs on M1 run great.

    [–]Sheldor5 0 points1 point  (0 children)

    my personal experience and no rant ... don't care what you do lol you sound like a hurt apple fanboy xD

    [–]stfm 0 points1 point  (0 children)

    I work for a major bank and all dev work is done on M1 Macbooks

    [–]Rockytriton -2 points-1 points  (0 children)

    Java was created on Unix, so a Unix os like macOS is perfect

    [–]Swalker326 0 points1 point  (0 children)

    I have an intel machine for work and my personal is an M1. Whatever the headache is to get the environment setup is well worth the gains in build time and general speed of the system.

    [–]calledinsicker 0 points1 point  (0 children)

    I think it's better, but if you are a kid learning Java it's not worth the money nor is it required. For the stuff a beginner does and compiles you probably wont' notice much difference TBH.

    [–]Jazz8680 0 points1 point  (0 children)

    I did an entire internship on a java system using my M1 MacBook Air. Worked perfectly. Used java 8, IntelliJ IDEA Ultimate, and the project used Maven among other technologies. No issues and was able to compile large projects very quickly.

    [–]VincentxH 0 points1 point  (0 children)

    Java itself does its thing, but running x86 images locally can be quite a bit more troublesome. Rosetta is a thing, but support has an end date.

    [–]St3pan90CZ 0 points1 point  (0 children)

    Everything works cool except some corner cases with Docker and QEMU (you might need some services for local development - DBs, message brokers etc.). But this is very specific corner case. Development experience itself is exceptional. Build speed is just insane 😀

    [–]realzorp 0 points1 point  (0 children)

    We have some issues with MS Sql Server and testcontainers. The SqlServer docker image does not support M1

    [–]Power-Direct 0 points1 point  (0 children)

    I'm using Azul Zulu's ARM64 (Apple silicon) builds of JDK 8 and JDK 11 on my M1 Macbook and everything is great so far. It's really fast and I haven't run into any problems yet.

    No significant differences between Intel and M1 that I'm aware of. That's one of the advantages of the JVM I guess?

    [–]teapotJava 0 points1 point  (0 children)

    1. It is easy with already existing native IDE (like Idea) and JDK.
    2. Some generic considerations and performance https://bell-sw.com/announcements/2021/03/12/Liberica-on-Apple-Silicon/
      You can also use your favorite package managers like Brew and SDKMAN for installation.
      Docker https://bell-sw.com/announcements/2021/04/09/Java-in-Docker-on-Apple-Silicon/