LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-22-2010, 06:53 AM   #1
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
JAVA_HOME defined but maven2 compains it could not find it


/usr/lib/jvm/java-6-sun-1.6.0.20/bin
is the directory where my Java resides.
in the .bashrc have following
Code:
JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.20/bin"
export JAVA_HOME
/etc/environment and /etc/profile
have the default entries no changes with them.
Code:
 echo $JAVA_HOME
/usr/lib/jvm/java-6-sun-1.6.0.20/bin
then Installed
Code:
aptitude install maven2
when I run mvn get error
Code:
Error: JAVA_HOME is not defined correctly.
  We cannot execute /usr/lib/jvm/java-6-sun-1.6.0.20/bin/bin/java
I am not having any clue as what is this error?
As to me JAVA_HOME seems to be defined.
 
Old 10-22-2010, 07:03 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
If you look at the error, you've got this:

Quote:
/bin/bin/java
Usually JAVA_HOME is defined as the root of the java tree, not the bin directory, so if you re-define it in .bashrc as

JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.20

it will probably work.
 
Old 10-22-2010, 07:05 AM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
The error tells you that JAVA_HOME is not defined correctly. It looks like you need to get rid of "bin" at the end..
 
Old 10-22-2010, 07:16 AM   #4
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Ok removing the bin seems to work.
I got rid of the error
but
Also worth mentioning
Code:
which java
/usr/bin/java
is not pointing to JAVA_HOME/bin/java
 
Old 10-22-2010, 09:52 AM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Have you looked to see if /usr/bin/java is a symlink to the JAVA_HOME/bin/java?
 
Old 10-22-2010, 11:23 AM   #6
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Ok I manually did that.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined xpucto Linux - Newbie 8 04-21-2020 02:26 PM
defined JAVA_HOME is not picked up some other path taken tkmsr Linux - Software 4 08-01-2010 09:28 AM
[SOLVED] JAVA_HOME not defined tkmsr Linux - Software 1 08-01-2010 04:33 AM
Neither JAVA_HOME nor the JRE_HOME variable defined Raakh Linux - Newbie 9 06-02-2007 06:40 AM
# ./startup.sh Neither the JAVA_HOME nor the JRE_HOME environment variable is defined Niceman2005 Linux - Newbie 3 06-29-2005 01:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration