Skip to main content
deleted 414 characters in body
Source Link
Roy Hinkley
  • 305
  • 1
  • 6
  • 16

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

Resolved - correct line in bashrc:

export PATH=$PATH:/usr/java/jre1.8.0_51/bin/

I don't know why, but using the environment variable pointing to symbolic link export PATH="$PATH:$JAVA_HOME" does not work, even though it's correctly resolving:

ls -l /usr/java/latest
    lrwxrwxrwx. 1 root root 21 Jul 21 15:34 /usr/java/latest -> /usr/java/jre1.8.0_51

I would really like to understand why?

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

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


ls -l /etc/alternatives/java
lrwxrwxrwx. 1 root root 20 Jul 21 17:42 /etc/alternatives/java -> /usr/java/glassfish4

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

Resolved - correct line in bashrc:

export PATH=$PATH:/usr/java/jre1.8.0_51/bin/

I don't know why, but using the environment variable pointing to symbolic link export PATH="$PATH:$JAVA_HOME" does not work, even though it's correctly resolving:

ls -l /usr/java/latest
    lrwxrwxrwx. 1 root root 21 Jul 21 15:34 /usr/java/latest -> /usr/java/jre1.8.0_51

I would really like to understand why?

deleted 414 characters in body
Source Link
Roy Hinkley
  • 305
  • 1
  • 6
  • 16

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 two linesline to .bashrc:

export  JAVA_HOME        /usr/java/jre1.8.0_51/bin
export  PATH             ${JAVA_HOME}/bin

But logging out and back in results in the following exception:

-bash: export: `/usr/java/jre1.8.0_51/bin': not a valid identifier

Can someone please tell me what I am doing wrong and not understanding?

EDIT

I have updated .bashrc with the following:

export PATH="$PATH:$JAVA_HOME"
export PATH=$PATH:$extra

But still get:

java -version
-bash: java: command not found

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 two lines to .bashrc:

export  JAVA_HOME        /usr/java/jre1.8.0_51/bin
export  PATH             ${JAVA_HOME}/bin

But logging out and back in results in the following exception:

-bash: export: `/usr/java/jre1.8.0_51/bin': not a valid identifier

Can someone please tell me what I am doing wrong and not understanding?

EDIT

I have updated .bashrc with the following:

export PATH="$PATH:$JAVA_HOME"
export PATH=$PATH:$extra

But still get:

java -version
-bash: java: command not found

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
added 203 characters in body
Source Link
Roy Hinkley
  • 305
  • 1
  • 6
  • 16

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

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 two lines to .bashrc:

export  JAVA_HOME        /usr/java/jre1.8.0_51/bin
export  PATH             ${JAVA_HOME}/bin

But logging out and back in results in the following exception:

-bash: export: `/usr/java/jre1.8.0_51/bin': not a valid identifier

Can someone please tell me what I am doing wrong and not understanding?

EDIT

I have updated .bashrc with the following:

export PATH="$PATH:$JAVA_HOME"
export PATH=$PATH:$extra

But still get:

java -version
-bash: java: command not found

I have installed a new JRE on my RedHat linux system. 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 ~]# 

/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 two lines to .bashrc:

export  JAVA_HOME        /usr/java/jre1.8.0_51/bin
export  PATH             ${JAVA_HOME}/bin

But logging out and back in results in the following exception:

-bash: export: `/usr/java/jre1.8.0_51/bin': not a valid identifier

Can someone please tell me what I am doing wrong and not understanding?

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 two lines to .bashrc:

export  JAVA_HOME        /usr/java/jre1.8.0_51/bin
export  PATH             ${JAVA_HOME}/bin

But logging out and back in results in the following exception:

-bash: export: `/usr/java/jre1.8.0_51/bin': not a valid identifier

Can someone please tell me what I am doing wrong and not understanding?

EDIT

I have updated .bashrc with the following:

export PATH="$PATH:$JAVA_HOME"
export PATH=$PATH:$extra

But still get:

java -version
-bash: java: command not found
Post Undeleted by Roy Hinkley
Post Deleted by Roy Hinkley
Source Link
Roy Hinkley
  • 305
  • 1
  • 6
  • 16
Loading