jdk:http://www.oracle.com/technetwork/java/javase/downloads/ Jdk8-downloads-2133151.html Choose 64-bit or 32-bit downloads based on the version of the Linux system, available in two versions of RPM and tar.gz. Installing:[[email protected] cdrom]# rpm -ivh jdk-8u25-linux-x64.rpm Configuring the JDK environment variable method One: Set the variable under the shell (this method is only valid for the current shell, and will need to be reconfigured if you open another shell) export java_home =/usr/java/jdk1.7.0_40/ export path= $JAVA _home/bin: $PATH export classpath=.: $JAVA _ Home/lib/dt.jar: $JAVA _home/lib/tools.jar (where only export path=/usr/java/jdk1.7.0_40/bin is configured: $PATH can also) method two: Modify the/etc/profile file (this method once and for all, set once, for all users) open the/etc/profile file with the Vim editor and add the definition of the environment variable at the tail of the file java_home=/usr/java/ Jdk1.8.0_25/path= $JAVA _home/bin: $PATHCLASSPATH =.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jarexport Java_homeexport pathexport classpath Save exit, view Java version [[Email protected] cdrom]# java -versionjava version "1.8.0_25" Java (TM) SE Runtime Environment (build  1.8.0_25-B17) Java hotspot (TM) 64-bit server vm (Build 25.25-b02, mixed mode) indicates installation success Method Three: Modify ~/. The BASHRC file (which is modified only for the current user and valid for all shells of that user) opens the ~/.BASHRC file with the Vim editor to add the definition of the JDK environment variable at the end of the file set java_home=/usr/java/ Jdk1.8.0_25/export java_homeset path= $JAVA _home/bin: $PATHexport pathset classpath=.: $JAVA _ Home/lib/dt.jar: $JAVA _home/lib/tools.jarexport classpath
Configuring the Java Development environment under Linux