Windows:
Set Java_home: View JDK Installation path
Java-version: View JDK version
Linux:
Whereis Java
Which Java (Java execution path)
Echo $JAVA _home
Echo $PATH
Two: Here are the environment variables for configuring Linux: (Remember source. bash_profile)
. Modify the/etc/profile file (global All users)
VI This file/etc/profile
At the end of the profile file, add:
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 (using these environment variables for a user right)
At the end of the. bash_profile file, add:
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
The shell terminal executes the following command: (for temporary use)
Export java_home=/usr/share/jdk1.6.0_14
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Three. Uninstalling the JDK
• Locate the _uninst subdirectory of the JDK installation directory
• Execute commands at the shell terminal./uninstall.sh You can uninstall the JDK.
Linux view Java JDK installation path and set environment variables