Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to setup Apache-James Server on Ubuntu, in which I am getting the annoying error:

JAVA_HOME not defined correctly

We cannot execute

I have already referred to the documentations and set up the PATH and JAVA_HOME variables correctly in the /etc/profile file. Upon calling echo, I get the values in the output screen. Where am I missing?

echo $JAVA_HOME
/usr/local/jdk1.6.0_27
echo $PATH
$PATH:/usr/local/jdk1.6.0_27/bin

Please Help !!

share|improve this question

migrated from stackoverflow.com Sep 15 '11 at 12:30

This question came from our site for professional and enthusiast programmers.

    
I'm getting the same error trying to run maven on ubuntu. Does that jdk path exist on your machine? If you are running a command line, does using sudo help? –  apollodude217 Apr 1 '12 at 12:32

2 Answers 2

If you want to set JAVA_HOME correctly,

Go into your terminal and type this :

whereis java

That will give you the path of the java installation then :

gedit /etc/bash.bashrc

(I'm using sun) add at the end of the file

export JAVA_HOME=/usr/lib/jvm/java-6-sun

Now you 've only have to reboot.

share|improve this answer

You could specify the JAVA_HOME (e.g. JAVA_HOME=/usr/local/java) in <JAMES_HOME>/bin/james-cli.sh to solve the issue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.