Tag Archives: The environment variable

Bug001: error in gradle configuration environment variable: ERROR:JAVA_ Home is set to an invalid directory!

Gradle-v error: Error: Java_home is set to an invalid Directory :C:\Java\jdk1.8.0_05
please set the java_home variable in you environment to match the location of your java installation.
On the Internet turned over again, some people said more than a semicolon, some people said to change this change that, I erase, others try it, My zha change is not in, is really angry evil old man!
Look at the picture first:


But when I looked up, My eyes were fixed on it!

Vonema, how did you automatically leave out the “Program Files “?

Then Windows+R, CMD, gradle-V, and sure enough! Problem solved smoothly!!

 

Error: could not find java.dll Error: could not find Java se runtime environment solution

DLL Error: could not find Java SE Runtime Environment
As title.
my situation is more complicated, and this is just a problem I had when reconfiguring Java environment variables.
My computer was originally configured with the latest JDK13, and the environment variables were set according to JDK13. Later JDK10 and JDK1.8 were downloaded for course reasons
Writing Java using Intellij Idea all the time has not been a problem. But a few days ago on a whim, I wrote a small program to run on the command line, and something went wrong
1. Javac conflicts with Java commands
It’s an error saying that the.class file I compiled with Javac is different from the version of the Java command that followed me. I checked the following with the -version command. My Javac is JDK13, and Java is a mix of JDK10 and 13.
because currently JDK10 is useless, it is removed, resulting in javac and Java command all die.
considering recent course requirements, we decided to simply reconfigure the JDK1.8 environment variable
2. Javac-version is not working properly
After resetting path and so on in accordance with the same configuration method, Java command reported the error as shown in the question, and JavAC was also not good. I searched for a circle on the Internet and finally had no choice but to restart the computer. The result javAC was actually normal, but Java was still abnormal
3. Java Error: could not find Java Runtime Environment
First we open the environment variable (just search “edit environment variable” by Corna on Win10)

We noticed that the path variable has an extra C:\Program Files(x86)\Common Files\Oracle… When executing Java commands on the command line, the default is to execute this Java first instead of adding our own %Java_Home%\bin, etc., so we need to put this added variable in front of the Oracle variable.
The problem is that I always end up with double quotes in front of the variable path, and the command line test still doesn’t work.
Continue searching and find someone said to change the java.exe in the System32 path, just rename it, but there is no Java.exe in my System32 path
Exe

as shown in the figure, j.xe
command line test successful!

After the