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.
- [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
- 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
- PLSQL even oracle11g problem on 64-bit machine: SQL*Net not properly installed and ORA-12154:TNS: cannot handle service name
- Could not initialize class gnu.io.RXTXCommDriver problem solution
- postman Error:There was an error connecting to XXXX
- Windows: Nginx configuration error GetFileAttributesEx
- [Solved] Virtualenvwrapper.sh error: There was a problem running the initialization hooks.
- Template Render Error Solution (Hexo blog theme, GIT upload)
- Execute an error under pytest cmd make sure your test modules/packages have valid Python names.
- Hive 3.1.2 startup error reporting and resolution of guava version conflict
- [step on the pit] idea submits the code to GitHub and prompts 403 — the requested URL returned error: 403
- error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory
- Java handles special characters in URL
- How to Solve “Status bar could not find cached time string image. Rendering in-process.” in Xcode
- Mybatis error under Springboot project: Invalid bound statement (not found)
- Filezilla Error: You appear to be behind a NAT router. Please configure the passive mode settings and …
- [Maven Error] Exception in thread “main” java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0