"Java -version " giving error

In Quiz section of JAVA Introduction , Quiz number 9 (Set path variable with the command export); I set the Env Variable for Java JDK.
[thor@app01 ~]$ export PATH=$PATH:/opt/jdk-13.0.2/bin
Now , when I run this command “java -version” , its giving following Error.
[thor@app01 ~]$ java -version
-bash: java: command not found
Kindly Suggest.
Thanks.

Hi @Deepti-Pore

It does work. I copied exactly what you have above.

[thor@app01 ~]$ export PATH=$PATH:/opt/jdk-13.0.2/bin
[thor@app01 ~]$ java -version
openjdk version "13.0.2" 2020-01-14

Ensure you got step 7 correct and java was extracted to the correct directory and is executable (presence of x in the permissions field - first column of output). Also files that are executable should shown in green on the output of ls

[thor@app01 ~]$ ls -l /opt/jdk-13.0.2/bin/java
-rwxr-xr-x 1 10668 10668 9000 Dec 11  2019 /opt/jdk-13.0.2/bin/java
1 Like

@Alistair_KodeKloud Thank You.It worked.