JAVA_HOME should point to a JDK not a JRE

We Are Going To Discuss About JAVA_HOME should point to a JDK not a JRE. So lets Start this Java Article.

JAVA_HOME should point to a JDK not a JRE

  1. JAVA_HOME should point to a JDK not a JRE

    I am going through the same process on Mac OSX. I installed the latest JDK, then installed Maven. Someone suggested I set the JAVA_HOME variable so I pointed it to the JDK installation folder. When running Maven mvn compile exec:java I received the same error NB: JAVA_HOME should point to a JDK not a JRE.

  2. JAVA_HOME should point to a JDK not a JRE

    I am going through the same process on Mac OSX. I installed the latest JDK, then installed Maven. Someone suggested I set the JAVA_HOME variable so I pointed it to the JDK installation folder. When running Maven mvn compile exec:java I received the same error NB: JAVA_HOME should point to a JDK not a JRE.

Solution 1

Control Panel -> System and Security -> System -> Advanced system settings -> Advanced -> Environment Variables -> New System Variable

enter image description here

Original Author sovas Of This Content

Solution 2

I am going through the same process on Mac OSX. I installed the latest JDK, then installed Maven. Someone suggested I set the JAVA_HOME variable so I pointed it to the JDK installation folder. When running Maven mvn compile exec:java I received the same error NB: JAVA_HOME should point to a JDK not a JRE.

All I did was unset the JAVA_HOME variable and it worked.

Original Author Dan Mergens Of This Content

Solution 3

do it thru cmd –

echo %JAVA_HOME%
set set JAVA_HOME=C:\Program Files\Java\jdk1.8.0
echo %JAVA_HOME%

Original Author Begineer Of This Content

Solution 4

I met the same problem. (Window 10 environment)
I solved it by deleting the JAVA_HOME=”C:\Program Files\Java\jdk1.8.0_161\bin” in the User Variables instead of adding to the System Variables directly.

Then I test that editing JAVA_HOME=”C:\Program Files\Java\jdk1.8.0_161\” worked too.
When I run “mvn -version” in command prompt window, it shows “Java home: C:\Program Files\Java\jdk1.8.0_161\jre”.

In conclusion, I guess the JAVA_HOME shouldn’t include bin directory.

Original Author Rui Sun Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment