java - How to set the JAVA_HOME in Mavericks 10.9? -



java - How to set the JAVA_HOME in Mavericks 10.9? -

i checked java installed on system.if come in whereis java shows me the

/usr/bin/java

i want set java_home, gave path /library/java/javavirtualmachines/jdk1.7.0_09.jdk/contents/home won't work.

if come in $java_home returns nothing.

if come in command /usr/libexec/java_home -v 1.7 shows me result

/library/java/javavirtualmachines/jdk1.7.0_09.jdk/contents/home

but while setting local workspace won't work says

`/library/java/javavirtualmachines/jdk1.7.0_09.jdk/contents/home` not valid `java_home`

how can resolve issue?

environment variables such stored in bash , users utilize configuration files set parameters bash environments.

for illustration in home directory have 1 or both of .bashrc or .bash_profile file.

1) open file

vi ~/.bash_profile

2) add together next line file

#default java 1.6 export java_home=`/usr/libexec/java_home -v 1.6`

this set $java_home variable path defined above. in case:

/system/library/java/javavirtualmachines/1.6.0.jdk/contents/home

once alter bash configuration file either need restart terminal or source file

source ~/.bash_profile

then confirm worked running command

echo $java_home

java tomcat osx-mavericks workspace

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -