i have used this command but not working
export JAVA_HOME=:/usr/bin/java
show error message:
    Error: JAVA_HOME is not defined correctly.
  We cannot execute :/usr/bin/java/bin/java
i have used this command but not working
export JAVA_HOME=:/usr/bin/java
show error message:
    Error: JAVA_HOME is not defined correctly.
  We cannot execute :/usr/bin/java/bin/java
 
    
     
    
    JAVA_HOME must be set to a directory that contains a bin sub-directory with a java executable in it.
In general, it is set to the root directory of a JDK or JRE. If you want to use the "system" java, set JAVA_HOME to /usr (and don't put a colon after the =):
export JAVA_HOME=/usr
 
    
    Try this:
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
or
export JAVA_HOME=/usr/java/jdk1.8.0_05
In this one, you need to rename jdk1.8.0_05 depending on the installed path on your system.
 
    
    Normally, you set such paths in ~/.bashrc.
Findout where is java location in your ubuntu machine. For help, check this: Where is the Java SDK folder in my computer? Ubuntu 12.04
after that add export line to your ~/.bashrc file
export JAVA_HOME=....