HomePhabricator
Diffusion Comm b0aac5ccf8f2

[docs] Adding `sdkman` and `11.0.13-zulu` instructions to JDK installation

Description

[docs] Adding sdkman and 11.0.13-zulu instructions to JDK installation

Summary:
Went through https://shift.infinite.red/dont-use-the-wrong-jdk-for-react-native-if-you-re-using-an-m1-mac-252533dd47a2 to install an M1 native JDK. This speeds up Android build speed by a notiecable margin and is good QoL.

This requires some change to the JDK installation in [docs]. Namely, using sdkman as an SDK manager (similar to what nvm does for Node).

Decided to use sdkman for both Intel and Apple-Silicon instruction sets. The difference is the specific JDK which is being installed. For Intel, we stick with the AdoptOpenJDK11, whereas Apple-Silicon will use this Azul 11.0.13-zulu. sdkman supports other JDKs if there is ever a need to change them in the future.

Changing the JDK means that the Android Studio instructions need to be changed as well. Gradle specifically needs to not use the built-in JDK baked into Android Studio, and instead use the JDK we have chosen.

There is more context in Linear task https://linear.app/comm/issue/ENG-199/[docs]-change-jdk-installation-instructions-for-m1-dev-environment , where it's determined that Gradle will "use whichever JDK is present in PATH, or JAVA_HOME if it exists.
I removed instructions for adding JAVA_HOME to the shell config, because sdkman takes care of this. It's not very apparent that this happens, but I wrote down my findings in the Linear task above.

Test Plan:
This is still in review for the Intel side of things.

For M1, I followed the steps in the diff to check that this would work, and Android builds would work.

This is also contingent on D2429 and D2430, which update Gradle version and update the execute() call in settings.gradle respectively.

This diff is therefore in "planned changes" until the above things are landed and tested.

Reviewers: atul, ashoat

Reviewed By: atul, ashoat

Subscribers: palys-swm, Adrian, karol-bisztyga, benschac, boristopalov

Differential Revision: https://phabricator.ashoat.com/D2472

Details

Provenance
anandAuthored on Nov 24 2021, 3:40 PM
Reviewer
atul
Differential Revision
Restricted Differential Revision
Parents
rCOMM2f84c6f515b2: [43/n] [landing] put footer on 12 column grid / re-implement
Branches
Unknown
Tags
Unknown