The development of the Java development environment and the use of eclipse to start building Java projects step by step.

The construction of the Java development environment and the use of eclipse to create a Java project step by step .

The main point here is how to configure the environment in the windows environment.

1. First install the JDK

Java sdk referred to as JDK, go to its official website to download the latest JDK. . Http://

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Click the downloaded exe file to install it.

2. Next we need to configure the environment variables

Right click on 'x computer' under xp system - attribute - advanced

Win7 system right click 'computer' - properties - advanced system settings - advanced map is win7 system demo

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Click on environment variable

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Next, you must have three attributes: JAVA_HOME, PATH, and CLASSPATH.

1. Configure the JAVA_HOME attribute

Find the directory where you installed the java SDK: C:\Program Files\Java\jdk1.8.0_101 (The java sdk1.8.0 version is the current demo version. If it is not a version, it doesn't matter, the installation configuration process is the same) Copy the path

Click on New under 'System Variables' in the figure above.

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Fill in the variable name 'JAVA_HOME', the variable value directly paste the last copied java SDK installation directory 'C:\Program Files\Java\jdk1.8.0_101', and then click "OK", the JAVA_HOME variable is configured. .

2. Configure the CLASS_PATH variable

Similar to configuring JAVA_HOME, click "New" in "System Variables" and enter them in the pop-up window.

Variable name: "CLASSPATH"

Variable value: ".;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\libools.jar;" (take the value inside the quotes, including the previous ".", where %JAVA_HOME% is configured before reference JAVA_HOME )

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Click "OK" to configure the CLASS_PATH variable.

3. Configure the path variable

Find if there is a path variable in 'system variable'

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

As shown above, the PATH variable is already in the system configuration. Click 'Edit' here, as shown in the figure below, you can see that the variable has a value. Add a semicolon (';') at the end of the variable value, and paste it. The path to the java SDK installation directory.

C:\Program Files\Java\jdk1.8.0_101\bin

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

3. Test environment variable configuration:

Then click 'Start' - 'Run', type 'cmd' or win+r shortcut to enter 'cmd'.

Enter java -version in the dos environment

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

After doing this, the environment variables we configured are correct.

Second, use elipse to create a java project step by step

1. Download eclipese

Official address: http://

2. Unzip eclipse.exe and you're done.

3. Establish a workspace

a. Open eclipse.exe The first interface appears, you need to set the workspace, we put it in the D disk workspace directory, click ok

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

b. Click on the “workbench” link in the upper right corner of the work area to enter the workbench.

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Open the work interface

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

c, create a java project

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

The pop-up page selects "Java Project"

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Project name can be filled in with its own project name. Other options use default values, click "Finish".

The workbench on the left will show the completed project.

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

d. New package package

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Right click on the 'src' package in the project and select new - package

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

There is no special requirement for the package name here, mainly the specification of the development agreement. The blog name is written here. Click finish to finish.

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

In the src directory, I will create a new class in the newly created PACKAGE package.

The development of the Java development environment and the use of eclipse to start building Java projects step by step.
The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Fill in the class name (class name is case sensitive), check the check box shown in the figure (public static void main (String [] args)), in order to automatically generate the main method, click "Finish" to complete.

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

The class file has been built.

d. Write a simple helloword and try it out.

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Add the following code: System.out.println("Hello World by http://");

7. Compile and run

Click Run--Run in the menu bar to compile and run, or directly press Ctrl+F11

There are many ways to start the program, and eclipse itself has a lot of shortcut buttons.

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

After the startup program runs successfully, the output can be seen in the console window.

The development of the Java development environment and the use of eclipse to start building Java projects step by step.

Moving Head Lights

Moving Head Lights,Led Moving Head,Mini Moving Head Light,Led Moving Head Light

Guangzhou Cheng Wen Photoelectric Technology Co., Ltd. , https://www.cwledwall.com

This entry was posted in on