Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vivek28

macrumors regular
Original poster
Sep 8, 2013
230
107
Theoretically you now need to purchase a license to use the Oracle JDKs. It's probably only enforced for large business use though. It doesn't look like the Azul JDKs have an installer but I could be wrong. They are easy enough to install without one. Just copy the JDK folder to /Library/Java/JavaVirtualMachines.

So for the Azul JDK11, you unzip zulu11.43.1007-ca-jdk11.0.9.1-macos_aarch64.zip and copy the zulu-11.jdk folder to /Library/Java/JavaVirtualMachines/

You can have multiple JDKs in the JavaVirtualMachines directory but the system will pick up the latest version. If you want to use an older one there is a command line tool that selects between whatever is installed.

To see what JDK is going to be used by default:
/usr/libexec/java_home

To see all of the JDKs available:
/usr/libexec/java_home -V

To set an older JDK:
export JAVA_HOME=`/usr/libexec/java_home -v 11`
# the quotes are backticks meaning execute in place
# the -v 11 chooses JDK11
# the change is temporary for the current session unless you change your .zshrc or .bashrc
okay, I would try Azul open JDKs on my current MBP. Would run and validate if everything works fine. ( Maven & Jenkins Integration and java selenium test results )

Yes I handled multiple Java versions in mac earlier also. Setting up JAVA HOME and changing the Path using vi /.bash_profile

Thanks?
 

ct2k7

macrumors G3
Aug 29, 2008
8,382
3,439
London
So I need to get the EAP for it to be a universal binary?

edit, it’s running on Azul Zulu
 

jdb8167

macrumors 601
Nov 17, 2008
4,859
4,599
So I need to get the EAP for it to be a universal binary?

edit, it’s running on Azul Zulu
If you want to check on a command line too to see if it is Arm64 you can use the lipo tool.

lipo -archs `/usr/libexec/java_home`/bin/javac

It should return:

arm64
 
  • Like
Reactions: ct2k7

christianjpg

macrumors newbie
Nov 19, 2020
1
0
Last edited:

nkdonut

macrumors newbie
Oct 7, 2020
8
8
brewarm?? Is this officially from Homebrew themselves?? Where do I find such thing
nvm. It's just a simple alias on an arm install of brew (no arch -x86-64 prefix) installed on /opt/homebrew.

For future readers: https://soffes.blog/homebrew-on-apple-silicon

Except instead of alasing the Rosetta2 version I aliased the arm version to brewarm
Apologies for the late reply - it’s indeed just an alias
 

dld9iv

macrumors newbie
Jan 15, 2021
2
0
Anyone was able to get either pyenv or virtualenv working in Apple Silicon environment to install a python2 environment? I have a legacy python application that requires python2, but I haven't found a way to setup a python2 virtual environment yet. If I use virtualenv installed by the built-in python3, I can create a virtualenv but when I run the python in there, I always get signal 9 and exit. I tried to install python2 via pyenv but it's got compiling errors. The venv module that comes with the Apple built-in python 3.8 cannot be used for python2. I think I'm running out of options.
 

UBS28

macrumors 68030
Oct 2, 2012
2,893
2,340
Anyone was able to get either pyenv or virtualenv working in Apple Silicon environment to install a python2 environment? I have a legacy python application that requires python2, but I haven't found a way to setup a python2 virtual environment yet. If I use virtualenv installed by the built-in python3, I can create a virtualenv but when I run the python in there, I always get signal 9 and exit. I tried to install python2 via pyenv but it's got compiling errors. The venv module that comes with the Apple built-in python 3.8 cannot be used for python2. I think I'm running out of options.

Try it with Anaconda maybe and see if you can create a python environment that works.
 
Last edited:

neilr_

macrumors newbie
Jan 18, 2016
13
2
The following was executed in a Terminal opened in Rosetta:

I installed pyenv 1.2.22 via homebrew, then installed 2.7.18. I created a new virtualenv using pyenv-virtualenv and was able to activate it and verify the running Python version with `python --version`.

While the above is my preferred way of dealing with Python versions, it might be worth mentioning that Big Sur comes with Python 2.7.16 preinstalled and available as `python2`. I have done exactly nothing with this version beyond verifying its existence.
 

dld9iv

macrumors newbie
Jan 15, 2021
2
0
Yep looks like after forcing my Terminal to launch in Rosetta, I was able to get pyenv to compile 2.7.18 properly, finally! Then everything else fell in place. My issue is resolved. Thanks a lot for the discussion here.
 

neilr_

macrumors newbie
Jan 18, 2016
13
2
Yep looks like after forcing my Terminal to launch in Rosetta, I was able to get pyenv to compile 2.7.18 properly, finally! Then everything else fell in place. My issue is resolved. Thanks a lot for the discussion here.
I made a copy of Terminal and set the "open in Rosetta" flag on it - that way I don't need to remember to toggle it (though, I rarely use Terminal - I prefer iTerm).
 

KarimLeVallois

macrumors 68030
Feb 22, 2014
2,607
1,772
London
Hey guys! Just started learning Python and will then go into Java, C/C+ etc. after that hopefully. I'm currently learning on my iPad Pro 2017, but obviously a laptop would be better. Would you guys recommend the M1 MBA or M1 MBP as I'm guessing I can't keep learning on just my iPad until the new MBPs come out in September/October/November.
 

pldelisle

macrumors 68020
May 4, 2020
2,248
1,506
Montreal, Quebec, Canada
Hey guys! Just started learning Python and will then go into Java, C/C+ etc. after that hopefully. I'm currently learning on my iPad Pro 2017, but obviously a laptop would be better. Would you guys recommend the M1 MBA or M1 MBP as I'm guessing I can't keep learning on just my iPad until the new MBPs come out in September/October/November.
Yes. Python and Pycharm are released as native ARM binaries. You can go with either one.
 

neilr_

macrumors newbie
Jan 18, 2016
13
2
Hey guys! Just started learning Python and will then go into Java, C/C+ etc. after that hopefully. I'm currently learning on my iPad Pro 2017, but obviously a laptop would be better. Would you guys recommend the M1 MBA or M1 MBP as I'm guessing I can't keep learning on just my iPad until the new MBPs come out in September/October/November.

What does "learning on your iPad Pro" mean? Do you have an app (like Pyto) or web environment that allows you to write code? If so, what can't you do now? i.e. Is there a specific need to spend the money now? I don't disagree that I would prefer to do my dev on a Mac, but it's also entirely possible that's because that's how I've always done it.

It sounds like you don't currently have a Mac, and thus no specific software that you're carrying around. In that case, an M1 Mac would seem to be a better future-resistant choice than an Intel-based Mac. Eventually, most of the software will catch up and run natively on Apple Si.

re: MBA now vs MBP now vs MBP later. What do you need from the machine? I bought a MBA because I wanted to play with Apple Si and I don't like the TouchBar. The extra battery life and thermal headroom of the MBP weren't priorities for me. I'd guess that for most development, there's not a lot of performance difference between the MBA and MBP. When Docker becomes available on Apple Si, that may change (Docker causes the fans of my x86 MBP to spin up fully whenever I start a container). Whatever you choose, you aren't making a lifelong commitment. You can always trade up to a machine that better meets your needs when that time comes. :)

I'd recommend Homebrew and pyenv for local Python development because that allows you install multiple versions of Python concurrently. Helpful if you want to evaluate features in a different version without committing to that version for your system. I'm also partial to VS Code over PyCharm, but PyCharm is a very good tool (and helpful if you're going to use the JetBrains portfolio of IDEs).
 

KarimLeVallois

macrumors 68030
Feb 22, 2014
2,607
1,772
London
What does "learning on your iPad Pro" mean? Do you have an app (like Pyto) or web environment that allows you to write code? If so, what can't you do now? i.e. Is there a specific need to spend the money now? I don't disagree that I would prefer to do my dev on a Mac, but it's also entirely possible that's because that's how I've always done it.

It sounds like you don't currently have a Mac, and thus no specific software that you're carrying around. In that case, an M1 Mac would seem to be a better future-resistant choice than an Intel-based Mac. Eventually, most of the software will catch up and run natively on Apple Si.

re: MBA now vs MBP now vs MBP later. What do you need from the machine? I bought a MBA because I wanted to play with Apple Si and I don't like the TouchBar. The extra battery life and thermal headroom of the MBP weren't priorities for me. I'd guess that for most development, there's not a lot of performance difference between the MBA and MBP. When Docker becomes available on Apple Si, that may change (Docker causes the fans of my x86 MBP to spin up fully whenever I start a container). Whatever you choose, you aren't making a lifelong commitment. You can always trade up to a machine that better meets your needs when that time comes. :)

I'd recommend Homebrew and pyenv for local Python development because that allows you install multiple versions of Python concurrently. Helpful if you want to evaluate features in a different version without committing to that version for your system. I'm also partial to VS Code over PyCharm, but PyCharm is a very good tool (and helpful if you're going to use the JetBrains portfolio of IDEs).
Thank you so much for taking the time to come back to me.

I am currently doing the ‘Python for Everybody’ course on freeCodeCamp and using an iPad Pro 2017 12.9 connected to a monitor and wireless keyboard/mouse. I’m using Pythonista and not found any problems yet, but feel like I’m losing out a bit on learning terminal commands and getting used to finding files etc. within it. Also wondering how the iPad IDE will fair when things get a little more intense in the curriculum.

I’m swaying more towards a MBA at the mo as like you say, I can always upgrade later on when required. Might dabble in music production too one day, so may need some extra power.
 

neilr_

macrumors newbie
Jan 18, 2016
13
2
It's being enforced on Edu users, so it'll not be long until it's enforced on everyone else.
jenv + Adopt OpenJDK for the win. :)

Snipped from my workstation setup doc:
# Install jenv to enable switching between Java versions brew install jenv echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc echo 'eval "$(jenv init -)"' >> ~/.zshrc mkdir -p ~/.jenv/versions # Add AdoptOpenJDK as a source brew tap AdoptOpenJDK/openjdk # Install OpenJDK 8 and add to jenv - enter password when prompted brew cask install adoptopenjdk8 jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home # Install OpenJDK 11 and add to jenv - enter password when prompted brew cask install adoptopenjdk11 jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home # Set a global Java version - takes effect on new shell jenv global 1.8

The above assumes that you're using Homebrew. I set Java 1.8 as the default because that's what we used at work when I wrote it. I haven't installed Java on my new Mac, so I'm not 100% if this is completely accurate or if it will work on an Apple Si Mac (I don't plan to install Java again).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.