facebook / react-native-website

The React Native website and docs
https://reactnative.dev
MIT License
1.91k stars 4.34k forks source link

Command to get zulu path is not correct #4130

Closed pokhiii closed 1 month ago

pokhiii commented 1 month ago

Description

In the Set Up Your Environment docs, the following command does not output what it intends to do – path to the zulu installation.

https://github.com/facebook/react-native-website/blob/b5789e91e747c796c71dc5e9921d37799c0038b8/docs/_getting-started-macos-android.md?plain=1#L27-L28

This is what it outputs, there is no path in here:

image

Documentation version

0.74

pokhiii commented 1 month ago

ChatGPT suggested:

/usr/libexec/java_home -v 17
tarunrajput commented 1 month ago

@pokhiii, you need to install the cask first

pokhiii commented 1 month ago

@tarunrajput, did I miss something in the setup steps? is that mentioned there?

tarunrajput commented 1 month ago

yes, you need to run brew install --cask zulu@17

pokhiii commented 1 month ago

is there an issue with my system? image

apicgg commented 1 month ago

@pokhiii After installing with brew install --cask zulu@17, make sure to update the JAVA_HOME env var. Add export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home into your ~/.bash_profile or ~/.zshrc.

This makes sure that if your java command will use the zulu@17 edition.

Also do check if this path /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home exists in your system after installation with ls -la /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home.