Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have never used Ubuntu before. How do I go about setting an environmental variable that points to JDK? I installed it on my Desktop. I typed in "EXPORT JAVA_HOME=~/Desktop/jdk" in the command prompt but it didn't work.

share|improve this question
    
remove "EXPORT" –  Dillmo Jun 30 '13 at 21:38
1  
make export lower case. –  ubfan1 Jun 30 '13 at 21:40

1 Answer 1

set environment variables as follows

Edit the system Path file /etc/profile

sudo gedit /etc/profile

Add following lines in end

JAVA_HOME=/usr/lib/jvm/jdk1.7.0
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

for reference http://javaandme.com

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.