JDK installation on Windows
1: Download the JDK. Address in http://www.oracle.com/index.html "downloads" se "Java Platform"2: Install the JDK. Customizing the installation directory, note
JDK and JRE need to be placed in different folders。 3: Configure the JDK environment variable. My Computer, properties, advanced environment variables
Java_home:D:/jdk
PATH:%java_home%\bin;%java_home%\jre\bin
CLASSPATH:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jartest the JDK for installation success: Run->cmd->d: Enter D, enter Javac to see if there are many commands, and the JDK configuration is successful.
Environment variables: environment variables are generally used in the operating system to specify the operating system running environment of some parameters, such as temporary folder location and System folder location. This is a bit like the default path of a DOS period, and when you run some programs, you look in the default path to the settings in addition to looking in the current folder. Simply put, the "path" here is a variable that stores the directory paths that are stored in common commands.
1, configuration Java_home=d:\program files\java\jdk1.6.0_18 Java_home point to the JDK installation directory; Java-developed software such as Eclipse/tomcat is the search for java_home variables to find and use the installed JDK, If you do not configure the Java_home variable, you will find that Tomcat does not start properly. 2, Configuration Path=%java_home%\bin Path points to the Search command paths, and if you do not configure this path variable to point to the JDK's command path, you will find the command line Unable to run Javac, Java and other commands; 3, configuration classpath=.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar Classpah points to the class search path,.; Represents a search in the current directory, because Java programs are often used in the Lib directory Dt.jar and Tools.jar the next class, so these two items also need to be added, if the command line to compile and run the program also needs to use to a third-party jar file, you will also need to include a third-party jar file.
JDK installation on CentOS
Installing the JDK# java-version# Rpm-qa | grep java# rpm-e--nodeps java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64 # wget http://download.oracle.com/otn/ Java/jdk/6u45-b06/jdk-6u45-linux-i586.bin? authparam=1432052036_e95492a0a833fa9ce7be7b3ce1e9427e # mkdir/usr/local/java# mv./jdk-6u45-linux-i586.bin/usr/ local/java/jdk-6u45-linux-i586.bin# cd/usr/local/java/# chmod u+x jdk-6u45-linux-i586.bin (or: chmod 777 Jdk-6u45-linux-i586.bin) #/jdk-6u45-linux-i586.bin (RPM File installation method: Rpm-ivh jdk-6u45-linux-i586.bin.rpm)
JDK default installation location:/usr/local/java/
Configuring Environment variables
# Vi/etc/profile
Append the following content to the file:
Export java_home=/usr/local/java/jdk1.6.0_45
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin
make changes effective immediately
# Source/etc/profile
Verifying the installation
# java
# Javac
# java-version
# echo $PATH
Congratulations, the installation is successful!
JDK Installation: CentOS and Windows environments