Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 $PATH

Please Help !!

share|improve this question

migrated from 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

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

Your Answer


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.