Skip to main content
3 of 4
deleted 414 characters in body
Roy Hinkley
  • 305
  • 1
  • 6
  • 16

How to update .bashrc with PATH

I have installed a new JRE on my RedHat linux system.

lsb_release -i -r
Distributor ID: CentOS
Release:    6.5

I have updated the symbolic links pointing to the desired Java installation:

ls -l /usr/bin/java
lrwxrwxrwx. 1 root root 21 Jul 21 16:27 /usr/bin/java -> /usr/java/jre1.8.0_51

ls -l /usr/java/latest
lrwxrwxrwx. 1 root root 21 Jul 21 15:34 /usr/java/latest -> /usr/java/jre1.8.0_51
[root@localhost ~]# 

ls -l /etc/alternatives/java
lrwxrwxrwx. 1 root root 20 Jul 21 17:42 /etc/alternatives/java -> /usr/java/glassfish4
[root@localhost ~]# 

But, now when I run:

java -version
-bash: java: command not found

Environment variables:

env
...
JAVA_HOME=/usr/java/latest
...

So I added the following line to .bashrc:

export PATH="$PATH:$JAVA_HOME"

But still get:

java -version
-bash: java: command not found
Roy Hinkley
  • 305
  • 1
  • 6
  • 16