Recently, I was relatively empty and wanted to study spring mvc, so I compiled the development environment step by step according to the tutorial. After configuring maven, when running the command mvn -v, an error was reported. The error message is as follows:
Error: JAVA_HOME not found in your environment.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
I carefully checked the configuration of JAVA_HOME and found that there is no problem. Why does it prompt this error?
I searched the Internet,
Some say that JAVA_HOME should point to the root directory of jdk and cannot contain /bin;
Some say that there cannot be a semicolon after the JAVA_HOME path;
Some say that there should be no spaces in the path, such as “Program Files” such path.
I checked these items one by one, but it didn’t solve my problem.
In the end, I found the problem accidentally, and found that when I run cmd as an administrator, this error will not be reported.
Read More:
- [Solved] The method getContextPath() from the type HttpServletRequest refers to the missing type String
- [Solved] At least one of these environment variable is needed to run this program
- Error: a JNI error has occurred, please check your installation and try again
- How to Solve elasticSearch8.1.2 Install Error in Win10
- VScode integrate terminal input node error [How to Solve]
- CMake Error: The source directory “opencv Install Catalog“ does not appear to contain CMakeLists.txt.
- [Solved] Hadoop Error: Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster
- Anaconda Error: ‘Destination folder’ contains 2 spaces. This can cause problems with several conda packa
- NVM ERROR open \settings.txt: The system cannot find the file specified
- [Solved] Matlab Code generate error: failed to generate all binary outputs
- Unable to find bundled Java version =>Mac Flutter [Android Studio Arctic Fox 2020.3.1]
- [Solved] Linux Start jar Error: nohup: failed to run command ‘java‘: No such file or directory
- PLSQL even oracle11g problem on 64-bit machine: SQL*Net not properly installed and ORA-12154:TNS: cannot handle service name
- NVM use error: exit status [How to Solve]
- [Solved] elasticsearch.bat Running Flashback.: Error occurred during initialization of VM, Error occurred during initializatio
- [Solved] Vscode debug error launch: Program “path” does not exist
- postman Error:There was an error connecting to XXXX
- How to Solve bootstrap.sh error during the construction of fabric environment
- [Solved] SpringMVC Error: war exploded: Error during artifact deployment. See server log for details.
- Could not initialize class gnu.io.RXTXCommDriver problem solution