I want to set it at startup in Ubuntu. Currently I have to manually set it after starting up.

link|improve this question
feedback

closed as off topic by Shane Madden, Ward, voretaq7, Chris S, Holocryptic Jan 24 at 13:54

Questions on Server Fault are expected to generally relate to servers, networking, or desktop infrastructure, within the scope defined in the faq.

1 Answer

You can add it to the /etc/environment file, making it part of every user's environment.

JAVA_HOME="/usr/lib/jvm/java-6-openjdk/"

To apply this change while the system is still running, use source /etc/environment.

Recommended reading: Enviroment Variables - Ubuntu community documentation.

link|improve this answer
Quotes are superfluous. – user unknown Jan 24 at 11:14
1  
@userunknown quotes aren't necessary, but make it easier for humans to read. – Chris S Jan 24 at 13:33
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.