Posts RSS Comments RSS 46 Posts and 34 Comments till now

JAVA_HOME: where do I set?

When you install Java (JRE or SDK) on linux system you have to set some environment variables, like JAVA_HOME, J2EE_HOME, etc.

Usually you have to set this variables for all users: system-wide level. OK, I agree. But where do I set JAVA_HOME?

Three alternatives:

  1. /etc/profile
  2. /etc/bash.bashrc
  3. /etc/environment

The first solution. I tried to set the environment variables in /etc/profile: it’s the right place for system wide variables, but in Ubuntu system seems not working.

The second solution worked for all users who use bash. Nice, but there’s another way.

The third solution is to use /etc/environment: in my opinion this is the best way, if the first solution fails.

References:

2 Responses to “JAVA_HOME: where do I set?”

  1. on 27 Aug 2007 at 8:44 pmAndreas Gohr

    If you install Java from the Debian packages (sun-java5-jdk), setting JAVAHOME shouldn’t even be needed, as the compiled in default values should match the installation directories.

  2. on 28 Aug 2007 at 12:42 pmpm

    Thank you Andreas! I’m happy about your comment.
    Thanks specially for your work “dokuwiki”.
    In my opinion is a great wiki.
    Thanks a lot!

Trackback this post | Feed on Comments to this post

Leave a Reply