简体   繁体   中英

JAVA_HOME in Ubuntu

i have installed jdk1.6 with netbeans 6.9 in my ubuntu10.10 it works fine ,i then try eclipse but it shows me the jdk or jre kit must be available to run eclipse. i set JAVA_HOME AND PATH IN MY /etc/enviroment file

`PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr`/games:$PATH:$JAVA_HOME:$JAVA_HOME/bin"

JAVA_HOME="/home/amit/jdk1.6.0_24"
CLASSPATH="/home/amit/jdk1.6.0_24/lib:."

but it doesn,t work java -version command did not work echo $java _ home works i also restart my pc. i also change it

JAVA_HOME="/home/amit/jdk1.6.0_24"
`PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr`/games:$PATH:$JAVA_HOME:$JAVA_HOME/bin"

CLASSPATH="/home/amit/jdk1.6.0_24/lib:."

but it still did not work thanks in advance

You need to have the definition of JAVA_HOME before the defintion of PATH. The expansion needs to take place at definition time, else it looks for the folder named "$JAVA_HOME" which you probably do not have.

echo $java _ home 

is wrong.

  • blanks aren't optional
  • we are case-sensitive

    echo $JAVA_HOME

is the right way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM