0

When I am trying to type in the bash profile the required commands it says that JAVA_HOME should point at a J.D.K. (Adopt Open J.D.K) and not at a J.R.E. It only worked, when i left the bash profile completely empty. But that was not what i should have been doing?

Maven also seems to find the Open J.D.K. runtime when I am leaving the bash profile empty...

I'm confused. Should i just let it be or do I HAVE to give a JAVA_HOME PATH in the bash profile?

  • 1
    which MacOS version you're using? – prostý člověk Nov 17 '20 at 18:46
  • I'm using OS Catalina 10.15.5. When I'm using mvn -v with an empty bash profile I get a response. But when I'm filling the bash profile with the commands that are required I get an error (JAVA_HOME not pointing to JDK but JRE error) –  Nov 17 '20 at 19:24
  • you need to set in ```.zprofile``` since you are using ```Catalina 10.15.``` – prostý člověk Nov 17 '20 at 19:28
  • Thank you very much for your answer. Laird Nelson sent me this here: https://github.com/apache/maven/blob/cecedd343002696d0abb50b32b541b8a6ba2883f/apache-maven/src/bin/mvn#L92-L96 I think i do not have to set JAVA HOME. –  Nov 17 '20 at 19:32

1 Answers1

0

You do not have to set JAVA_HOME.

Laird Nelson
  • 15,321
  • 19
  • 73
  • 127
  • Thank you very much for your answer Mr. Nelson. I'm quite the beginner when it comes to Maven. I have to use it for a student project. I was quite confused, when command mvn -v was working with an empty bash profile, but not with the JAVA_HOME and PATH lines in it (as it is instructed on the internet). –  Nov 17 '20 at 19:26
  • Sure; no problem. Was your `JAVA_HOME` set to a directory with whitespace in the name by any chance? – Laird Nelson Nov 18 '20 at 02:06
  • The only whitespace that I used was before the "=" sign. I'm still not sure why I got that error. But Maven works with an empty bash profile now when I use "mvn -v" in the Terminal. –  Nov 18 '20 at 08:23