Updated on 2024-03-06 GMT+08:00

Preparing a Java Development Environment

Scenario

Before installing and using Java SDKs, make sure you have completed the basic configuration of your development environment.

Java SDKs require JDK 1.8 or later. To ensure compatibility with future versions, it is recommended to use version 1.8.

Once the Java runtime environment is configured, you can open the Windows command line and execute the command Java -version to check the version information.

Procedure

  1. Install the JDK. Download the JDK 1.8 installation package from Oracle official website and install it.
  2. Set environment variables. Specifically, choose Start > Control Panel. Click System > Advanced system settings. In the displayed System Properties dialog box, click Advanced and then click Environment Variables to switch to the Environment Variables dialog box.
  3. Create the system variable JAVA_HOME with Value set to the JDK installation path, for example, D:\Java\jdk1.8.0_45.
  4. Edit the Path variable and add %JAVA_HOME%\bin to Variable value.
  5. Create the CLASSPATH variable with Variable value set to .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar.
  6. Check whether the configurations succeed. Specifically, at the Start menu, enter cmd and press Enter to bring up the command prompt window. Enter java -version and press Enter. If the version information is displayed, as shown in Figure 1, Python is successfully installed and configured.
    Figure 1 Checking the configuration