JDK installation configuration in Windows Tutorial

Source: Internet
Author: User

1. Preparatory work

  A. Because the Java JDK distinguishes between 32-bit and 64-bit systems, you must first determine how many bits of our system are in place before installing. Right-click Computer-Properties view, I installed 64-bit

b. Download JDK, Address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, I downloaded the JDK for 8,:

2. Installing Java JDK8.0

    A. Double-click on the downloaded JDK to install it, next step to go, don't say much.

3. Configure environment variables (automatically set with BAT file)

A. Create a file Java_home.bat

B. Copy the following code into the file. Note Modify your JDK installation path: C:\Program files\java\jdk1.8.0_77

-The first Kind

@echo off:: Configure java_home WMIC Environment create name="Java_home", username="<system>", variablevalue="C:\Program files\java\jdk1.8.0_77": : Configuration: CLASSPATH WMIC Environment create name="CLASSPATH", username="<system>", variablevalue=".; %%java_home%%\lib\dt.jar;%%java_home%%\lib\tools.jar;": : Configuration: PATH WMIC Environmentwhere "name= ' PATH ' and username= ' <system> '" SetVariablevalue="%%java_home%%\bin;%%java_home%%\jre\bin;%path%"Pause

--The second type (turn from: http://www.cnblogs.com/flowwind/p/4066146.html)

@echo off:: TODO: Setting the Java environment variable:: Author:gwtcolor Geneva:: Set Java installation path, easy to switch between different versionsSetinput=Set/P"input= Enter the Java JDK path (or enter the default path to C:\Program files\java\jdk1.7.0_71):"ifDefined input (echo JDK is set)Else(SetInput=c:\program Files\java\jdk1.7. 0_71) The echo JDK path is%input%Setjavapath=%input%:: If any, remove java_homewmic environment firstwhere "name= ' Java_home '"Delete :: If any, remove Class_path WMIC environment firstwhere "name= ' Class_path '"Delete:: Creating java_homewmic Environment Create name="Java_home", username="<system>", variablevalue="%javapath%":: Creating class_pathwmic Environment Create name="Class_path", username="<system>", variablevalue=".; %%java_home%%\lib\tools.jar;%%java_home%%\lib\dt.jar;":: In the environment variable path, remove the character from the variable java_home and echo the remaining string callSetXx=%path%;%java_home%\jre\bin;%java_home%\bin::echo%xx%:: Re-assigns the returned explicit character to the path in WMIC environmentwhere "name= ' Path ' and username= ' <system> '" SetVariablevalue="%xx%"Pause

JDK installation configuration in Windows Tutorial

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.