Building Java development environment and using Eclipse to create Java projects from the ground up

Source: Internet
Author: User

First, the construction of the Java Development environment

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

1. Install the JDK first

Java's SDK is referred to as the JDK, to its official website to download the nearest JDK. Http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Click the download good EXE file installation.

2. Next we need to configure the environment variables

The XP system right-click on ' My Computer '--Properties--Advanced

Win7 System right-click ' Computer '--Properties--Advanced system Settings-Advanced diagram is win7 system demo

Click Environment variables

Next with Java_home,path, CLASSPATH three properties ...

1. Configuring the Java_home Property

Locate the directory where the Java SDK is installed: C:\Program files\java\jdk1.8.0_101 (Java sdk1.8.0 version is the current demo version, if not a version, it does not matter, the installation is the same as the configuration process), copy the path

Click New under ' System variables '

The variable name is filled with ' java_home ', the variable value is directly pasted the last copy of the JAVA SDK installation directory ' C:\Program files\java\jdk1.8.0_101 ', and then click "OK", the Java_home variable is configured.

2. Configuring the Class_path variable

Similar to configuring Java_home, in the "System variables" click "New", in the popup window to enter
Variable name: "CLASSPATH"
Variable value: ".; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; " (Enclose the value in quotation marks, including the preceding ".", where%java_home% refers to the previously configured java_home)

Click "OK" to configure the Class_path variable.

3. Configure the PATH variable

Find out if the path variable is already in the ' system variable '

For example, the system configuration already has the PATH variable, here Click ' Edit ', as shown, you can see that the variable has a value, at the end of the variable value with a half-width semicolon (';'), and then paste the Java SDK installation directory path.

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

3. Test environment variable configuration:

Then click ' Start '--' run ', enter ' cmd ' or ' win+r ' to enter ' cmd '.

Enter java-version in a DOS environment

By doing this, we've configured the environment variables to be correct.

Second, use Elipse to create a Java project from the beginning step

1. Download Eclipese

Official address: http://www.eclipse.org/downloads/

2. Unzip and run the Eclipse.exe.

3. Set up a working space

A. Open Eclipse.exe the first interface, you need to set up a workspace, we put in the D-Disk workspace directory, click OK

B. Click on the "Workbench" link in the upper right corner of the work area to enter the Workbench

Open the Work interface

C. Create a Java project

The page that pops up is selected "Java Project"

Project name fills in your project name, other options take the default value, click "Finish".

The workbench on the left shows the works that have been built.

D. New Package Packages

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

There are no special requirements for the package name here, the main development of the Convention specification, which is written in the name of the blog. Click Finish to complete.

In the SRC directory, I have just created a new class for my newly created package.

Fill in the class name (class name note case), tick the check box (public static void main (string[] args), is to automatically generate the main method, click "Finish" to complete.

The class file is already built.

D. Write a simple Helloword and try it for a little bit.

Add the following code: SYSTEM.OUT.PRINTLN ("Hello World by http://www.cnblogs.com/smivico/");

7. Compile and run

Click Run--run on the menu bar to compile the run, or press CTRL+F11 directly

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

After the startup program runs successfully, you can see the output in the console window.

Building Java development environment and using Eclipse to create Java projects from the ground up

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.