Hello all,
And, thanks for the help in the past.
I want to install the Java Developer Kit, along with Apache-Maven, so that I can do some Java tutorials in VS Code.
I installed jdk1.8.0_181 to /opt/java/jdk1.8.0_181/bin and apache-maven to /home/mike/apache-maven/apache-maven-3.5.4/bin.
According to instructions, I have to set the environmental variable JAVA_HOME to the directory that contains the files java and javac. I did this using the command export JAVA_HOME=/opt/java/jdk1.8.0_181/bin.
I also changed the PATH environmental value to include :/home/mike/apache-maven/apache-maven-3.5.4/bin
However, when I type mvn -v, I get the error message: The JAVA_HOME environmental variable is not defined correctly.
I make sure that JAVA_HOME is set correctly by using echo $JAVA_HOME, and it is pointing to the correct directory. Also, I go to the directory, and type ls, and I can see java and javac.
Any suggestions as to what I'm doing wrong?
-Thanks
-CodeSchocker
Java jdk1.8.0_181
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Java jdk1.8.0_181
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Java jdk1.8.0_181
Hi, CodeSchlocker.
JAVA_HOME is the directory level above the "bin" directory. Therefore the correct export command in your case would read
Best regards,
Karl
JAVA_HOME is the directory level above the "bin" directory. Therefore the correct export command in your case would read
Code: Select all
export JAVA_HOME=/opt/java/jdk1.8.0_181
Karl
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
Re: Java jdk1.8.0_181
Thanks, Karl,
That seems to straighten out the JAVA_HOME environmental variable issue.
But, I just run mvn -v again and get a message from bash saying that I need to install it, which, I believe I already have.
I think I know the issue. I need to edit PATH in the .bashrc or the .profile. I think that issue is that the PATH I was using the other day was only temporary.
Yes, that did the trick.
Thanks again,
CodeSchlocker
That seems to straighten out the JAVA_HOME environmental variable issue.
But, I just run mvn -v again and get a message from bash saying that I need to install it, which, I believe I already have.
I think I know the issue. I need to edit PATH in the .bashrc or the .profile. I think that issue is that the PATH I was using the other day was only temporary.
Yes, that did the trick.
Thanks again,
CodeSchlocker