Windows:

Set JAVA_HOME: View the JDK installation path

Java-version: Displays the JDK version





Linux:

whereis java

Which Java (Java Execution pathThis output is used to configure the location of Java

echo $JAVA_HOME

echo $PATH

 

 

Here are the environment variables to configure Linux: (remember source.bash_profile). Modify the /etc/profile file (for all users globally) vi Add the following file to the end of the profile file: Export JAVA_HOME=/usr/share/jdk1.6.0_20 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar . Modify the.bash_profile file (a user permission uses these environment variables)

Add the following to the end of.bash_profile: Export JAVA_HOME=/usr/share/jdk1.6.0_20 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar. (Temporary) export JAVA_HOME=/usr/share/jdk1.6.0_14 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH =. : $JAVA_HOME/lib/dt. The jar: $JAVA_HOME/lib/view jar three. Uninstall the JDK · Locate the _uninst subdirectory of the JDK installation directory · Run the./uninstall.sh command on the shell terminal to uninstall the JDK.