Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 33984  / 1 Year ago, tue, march 28, 2023, 9:49:23

I installed Java JDK on Ubuntu 12.04 and added Java home to my path at ~/.bashrc:



export PATH=/opt/jdk1.7.0_40/jdk1.7.0_40/bin:$PATH


This looks a little bit strange but it's really my path.



After this I installed maven through:



sudo apt-get install maven


It installed all the needed libraries and now when I run mvn -version, I see:



Error: JAVA_HOME is not defined correctly.  
We cannot execute /opt/jdk1.7.0_40/bin/java


What is wrong with it?




  • How to solve this trouble?


More From » 12.04

 Answers
5

You should add these lines to your ~/.pam_environment file instead (create it if it doesn't exist)



PATH DEFAULT=${PATH}:/opt/jdk1.7.0_40/jdk1.7.0_40/bin
JAVA_HOME DEFAULT=/opt/jdk1.7.0_40/jdk1.7.0_40


More information (read this)



Using .bashrc is not recommended at the above link.


[#29128] Wednesday, March 29, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sigtestim

Total Points: 298
Total Questions: 108
Total Answers: 106

Location: Bermuda
Member since Thu, Apr 20, 2023
1 Year ago
;