The fastest shortcut in the world is to keep your feet on the ground. Focus on the sharing place.

The paper

A few days ago, MacOS pushed the new system Big Sur, like to catch up with the new system, I immediately updated kakaka, how delicious.

Coming into the office this morning to make tea and get ready to go, huh? Why can’t MY local nacos get up?

Look at the error message:

no such /Library/Internet
Copy the code

It’s… Ha ha ha, mom sell approval! After my careful inference, this is not recognized my JDK path ah. (MY local JDK is the official website off directly installed)

Here are the reasons for the problem:

In macOS 11.0.1 system/Library/Internet plug-ins/JavaAppletPlugin plugin/Contents/Home such Internet plug-ins JDK Spaces The path was not recognized, which was recognized by macOS 11.0.1, which caused our NACOS to fail to start.

If $JAVA_HOME is not configured manually, use the default JAVA_HOME with Spaces. If the shell fails to execute, manually specify your own JAVA_HOME.

JDK environment Configuration

Download the JDK

Download the Java Development Kit (Java Development Kit) from Oracle’s official website. If you have installed the JDK before, start with step 2.

2. Check the JDK

Enter the command on the local terminal to view the JDK path after installation

/usr/libexec/java_home -V
Copy the code

Copy the path/Library/Java/JavaVirtualMachines jdk1.8.0 _221. JDK/Contents/Home stay for a while

Configure the JDK environment

If you have a. Bash_profile profile, enter open-e. bash_profile on the TERMINAL to open the profile.

If not, enter the command:

touch .bash_profile
Copy the code

Then enter the command to open the file

open -e .bash_profile
Copy the code

After the command is executed, text editing is directly opened and parameters are copied to it

JAVA_HOME = / Library/Java/JavaVirtualMachines jdk1.8.0 _221. JDK/Contents/Home PATH = $JAVA_HOME/bin: $PATH:. CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:. export JAVA_HOME export PATH export CLASSPATHCopy the code

Note: If you are using vim to open the file, press Esc and enter :wq to exit. If it is a text editor direct command + S save and close.

Enter the following command for the configuration file to take effect

source .bash_profile
Copy the code

Check the environment variables to see if they were configured successfully

echo $JAVA_HOME
Copy the code

Enter the command to view the current JDK version

java -version
Copy the code

Restarting our NACOS solved the problem perfectly

The end of the

Although the solution to the problem is simple, we also need to understand the basic configuration knowledge of JDK in the process.

In the development will often encounter often a very good B problem, in fact, made a very two mistake.