Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Help with "which" and environment variables please


    I have a new CentOS 6.3 installation. I'm a little confused about environment variables.

    I installed the Java 7 SDK in /usr/java/jdk7

    I placed a file called in /etc/profile.d... the contents of which are:

    export JAVA_HOME=/usr/java/jdk7
    export PATH=$JAVA_HOME/bin:$PATH

    When I typed java -version from the command line, I got this:

    OpenJDK Runtime Environment (IcedTea6 1.11.5) (rhel-
    OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

    Which is WRONG. So I did which java and got this:


    But if I do set | grep PATH


    I see the /usr/bin is in the path and I'm guessing that's how the OpenJDK gets seen instead of my install of the JDK.

    The problem is, I obviously want "which java" to reflect my install and not the one in /usr/bin/java

    Any assitance you can provide is greatly appreciated. Thanks!

  2. #2

    I am not an linux expert but you can check your system environment as use command env as there are few Java related veriables


    try to change them to java you want to use.
    I think it removing OpenJDK is a valid scenario.

    I hope this helps.

    Best Regards,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts