Reputation: 115
I am trying to run maven project in the intelliJ, then got an error
JAVA_HOME is set to an invalid directory.
JAVA_HOME = "H:\jdk\1.8\bin"
Please set the JAVA_HOME varialbe in your environment to match
the location of you Java installation
I have changed the environment variable in system to "H:\jdk\1.8", and restart the intelliJ, still got the same error. But in system command prompt, the java_home is already "H:\jdk\1.8"
Does anyone know how to solve it? Thank you.
Upvotes: 1
Views: 869
Reputation: 401965
Environment variables are inherited from the parent process and are not updated on the fly in most cases. You should logout/login or reboot for the environment variables to have effect for all the apps on the system.
Upvotes: 1
Reputation: 612
If you are using JetBrains Toolbox, restart it. IntelliJ inherits old environment variables from toolbox's process.
Upvotes: 1