JDK Installation: CentOS and Windows environments

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.