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
So I am looking to replace my macbook pro.

Has anyone tried installing python/java x86 binaries and respective IDEs Pycharm/Eclipse/IntelliJ on their new M1 Macs ?

I use python for AI tasks.. working with dataframes and plotting in seaborn. I use Java to create/run test for automated software tests.


Do they run fine with Rosetta2 translation? no compile or errors of any kinds ? Pls help.
 

nkdonut

macrumors newbie
Oct 7, 2020
8
8
Python 3 works!

1605749707425.png
 
  • Like
Reactions: mlykke and matrix07

nkdonut

macrumors newbie
Oct 7, 2020
8
8
IntelliJ does appear to work under Rosetta 2 as well. It appears to be using OpenJDK 15 (x86_64).
1605750748249.png
 

vivek28

macrumors regular
Original poster
Sep 8, 2013
230
107
There is a JDK 16 available: openJDK 16 macOS+AArch64

You can just copy the jdk-16+10/ folder to /Library/Java/JavaVirtualMachines/ and then create a softlink to latest.jdk with the command line: sudo ln -s jdk-16+10 latest.jdk

thats cool, but Jenkins to automate builds.. isnt compatible with all Java versions

Screen Shot 2020-11-19 at 7.29.30 AM.png
 

yanksrock100

macrumors 6502a
Oct 30, 2010
673
245
San Diego
As others have said, there is a standard 3.8 installation that runs on the ARM platform. Using Rosetta you can install Homebrew and run the x86 version of Python3.x.

I will note that not all development tools work at the moment, even using Rosetta 2. For example, I am unable to go through the installation process for the required tools for React Native.
 

neilr_

macrumors newbie
Jan 18, 2016
13
2
As others have said, there is a standard 3.8 installation that runs on the ARM platform. Using Rosetta you can install Homebrew and run the x86 version of Python3.x.

I will note that not all development tools work at the moment, even using Rosetta 2. For example, I am unable to go through the installation process for the required tools for React Native.
I was able to install pyenv and pyenv-virtualenv via Homebrew, but they were not able to install a Python version (tried 3.8.6 and 3.9.0). I stopped using the Python 3 package directly from Homebrew once I started using pyenv and pyenv-virtualenv. Do you use a different virtualenv solution?
 

yanksrock100

macrumors 6502a
Oct 30, 2010
673
245
San Diego
I was able to install pyenv and pyenv-virtualenv via Homebrew, but they were not able to install a Python version (tried 3.8.6 and 3.9.0). I stopped using the Python 3 package directly from Homebrew once I started using pyenv and pyenv-virtualenv. Do you use a different virtualenv solution?
I was able to create virtual environments using the preinstalled 3.8.2 (ARM) and Homebrew's 3.9.0 (x86) by using venv.

Code:
>> python3 -m venv /path/folder
>> cd /path/folder
>> source bin/activate
(inside env)
>> which python
/path/folder/bin/python

Full guide on Python.org: https://packaging.python.org/guides...-environments/#creating-a-virtual-environment
 

neilr_

macrumors newbie
Jan 18, 2016
13
2
I haven't used Python's built-in venv. Looks like you need to be inside the folder where you created it before you can activate it?

Thanks for pointing out that option.
 

yanksrock100

macrumors 6502a
Oct 30, 2010
673
245
San Diego
I haven't used Python's built-in venv. Looks like you need to be inside the folder where you created it before you can activate it?

Thanks for pointing out that option.
Looks like you can activate it from outside the folder, that `cd` is unnecessary. :D

I think venv is the newest option (as of Python 3.3ish?). And it's part of the standard library! :)
 

Wortak

macrumors newbie
Nov 16, 2020
20
13
Some apps have the jre already included, however it’s x64 then of course. Is there an easy way to force them to use the native arm64 OpenJDK instead?
 

vivek28

macrumors regular
Original poster
Sep 8, 2013
230
107
There is a JDK 16 available: openJDK 16 macOS+AArch64

You can just copy the jdk-16+10/ folder to /Library/Java/JavaVirtualMachines/ and then create a softlink to latest.jdk with the command line: sudo ln -s jdk-16+10 latest.jdk
I have always used oracle Java JDKs.. does Azul open jdks works seamlessly ? I heard only difference is of the installer.

I use Java Selenium classes mostly to create/run automated web tests using Junit/testNG frameworks.
 

jdb8167

macrumors 601
Nov 17, 2008
4,859
4,599
I have always used oracle Java JDKs.. does Azul open jdks works seamlessly ? I heard only difference is of the installer.

I use Java Selenium classes mostly to create/run automated web tests using Junit/testNG frameworks.
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
 

jido

macrumors 6502
Oct 11, 2010
297
145
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.
Azul is based on OpenJDK, which is and always was free.

Oracle says their own JDK share source code with OpenJDK starting with Java 11, so you should have same implementation if you use Azul zulu11 or Oracle jdk11. Same with later Oracle LTS releases.
 
  • Like
Reactions: vivek28
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.