- To install the JDK, of which the JDK includes the jre, www.oracle.com/java/techno… , select MacOS, m1 to download the ARM version, or select another JDK version, this is JDK17
- Once the download is complete, install foolproof, next step, and finally download is complete
- Configure environment variables and turn on terminal input
vim ~/.zshrc
ZSHRC is the configuration file to configure the Java environment variables, my address is/ Library/Java/JavaVirtualMachines/JDK - 17.0.1. JDK/Contents/Home
In the ZSHRC file, write the javA_HOME environment variable
Export JAVA_HOME = / Library/Java/JavaVirtualMachines/JDK - 17.0.1. JDK/Contents/HomeCopy the code
- Test, output HelloWorld, tool IDEA
New Project – Select the Java module Select Add JDK Select the JDK – 17.0.1. JDK Next, customize. Do not choose the default template
Define the project name and click Finish The new package name
Create classes under the newly created package Right click run