Hello want some clarity on export $ path commad

i am using WLS 10.3.6 and my java - version = jDK 1.7 and as per export ,i am confusing more…
in my case

$ echo $PATH

/usr/lib64/qt-.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/jdk1.7.0_67/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:./:/root/bin

This is the output i got ..what is path, class path and meaning for my above path ??? reply me to at '**nlkalyan.434@gmail.com**"

@nlkalyan434

Use the following ‘which’ command to find out exact location of java executable under UNIX / Linux:

$ which java
Then, set **JAVA_HOME** path using following export command. Don't forget to mention correct location of your Java..
$ export PATH=$PATH:/path-to-java/

These are path to system and application binaries. You should not edit/overwrite them unless you know what you are doing.

I Assume Java is installed at /opt/java/jdk1.7.0_67/ directory. Change it as per your installation.

To set Java Path
# export PATH=$PATH:/opt/java/jdk1.7.0_67/bin:/opt/java/jdk1.7.0_67/jre/bin

If You are not using jre or do not want to set jre path use only
# export PATH=$PATH:/opt/java/jdk1.7.0_67/bin
The first part $PATH ensures rest of the system paths remains unchanged.

Optional
To set Java Environmental Variable
# export JAVA_HOME=/opt/java/jdk1.7.0_67/
# export JRE_HOME=/opt/java/jdk1.7.0_67/jre

The current release of Java is Java 8 Update 45 (jdk1.8.0_45). It is recommended to update/install latest Java Version. Here is the link to install Java in Linux, the easiest way : http://www.tecmint.com/install-java-jdk-jre-in-linux/

1 Like