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] Appium Install Error: Original error: Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variab
- [Maven Error] Exception in thread “main” java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
- Start error in maven web project java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener
- [Solved] Non-fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library “libmmkv.so“ not found
- [Solved] Error: Django is not importable in this environment
- JSP error: The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- [Solved] java.lang.UnsatisfiedLinkError: dlopen failed: /lib/arm64/libc++_shared.so not found
- How to Solve Error: java.io.IOException: Resource [classpath:shiro.ini] could not be found.
- [Solved] MindSpore Error: ReduceMean in the Ascend environment does not support inputs of 8 or more dimensions
- [Solved] STS Console Error: error unknown mavem Maven Configuration Problem
- [Solved] Goland sdk Error: The selected directory is not a valid home for Go SDK
- [Solved] Flume Error: java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
- [Solved] Vscode Error: “export ‘default‘ (imported as ‘VueRouter‘) was not found in ‘vue-router‘
- An error was reported when Maven package was running the packaged jar package: there is no main list attribute in xxx.jar, which can be solved by configuring Maven plugin
- [Solved] Error in porting libzrtp: automake-1.14: command not found
- [ERROR FileExisting-conntrack]: conntrack not found in system path
- [Go] Solve the problem of exec: “gcc” executable file not found in %PATH% error when using cgo
- [Solved] Spark Error: ERROR StatusLogger No log4j2 configuration file found
- Module not found: Error: Can‘t resolve ‘sass-loader‘ in…
- [Solved] Vue3 Error: export ‘createRouter‘ was not found in ‘vue-router‘