zshrc for me) so it is available in all terminal sessions. Make sure to add the javahome function to your shell init file (. javahome() alias j1.8='javahome 1.8' alias j11='javahome 11' alias j17='javahome 17' I prefer the javahome shell function below rather than adding new values to PATH. Installing JDKs with brew also recommends adding /usr/local/opt/openjdkXX/bin to PATH. Setting the symlink after every installation step is important for the system Java wrappers to find the installed JDK. That includes JAVA LTS releases 17, 11, 8: # version 17 brew install sudo ln -sfn /Library/Java/JavaVirtualMachines/openjdk-17.jdk # version 11 brew install sudo ln -sfn /Library/Java/JavaVirtualMachines/openjdk-11.jdk # version 8 brew install sudo ln -sfn /Library/Java/JavaVirtualMachines/openjdk-8.jdk On Mac you can install Java/JVM with brew’s openjdk formulae. While focusing on one Java version at Miro, we’d like to share in this write-up how to switch between Java/JDK versions on Mac via the command line. Also we like to share our reflections and engage with the community.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |