Note: Pre-Installation Prerequisites: You must install the JDK environment before installing Eclipse. The main installation methods are: Download JDK, install JDK, configure the environment variables of JDK, test and install the JDK. Detailed steps are detailed in the blog:
Java Development Environment Building
Use Eclipse to create a Java project from a single step
1. Download Eclipse
Website address: http://www.eclipse.org/downloads/
Download Eclipse IDE for Java EE developers
2. Decompression Run
Unzip the downloaded Eclipse-jee-kepler-sr1-win32-x86_64.zip file,
This is a free-to-install package that runs Eclipse.exe directly.
3. Building the Project
1). Set up a working space
Open the first interface that appears Eclipse.exe:
To set up a workspace, we place the workspace directory in D and click "OK".
2). Click on the "Workbench" link in the upper right corner of the workspace to enter the Workbench
Open the Workbench interface
3). Create a Java project
Click File--new--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.
4). New Package
Right-click on the "src" package in the project and select "New"-"packages"
There is no special requirement for the package name, which is mainly the specification stipulated in the development.
Here we use the name of this blog: blog.csdn.net.unix21
Click "Finish" to finish.
in the SRC directory, we have just created our new package. It's actually a folder.
For example, the package name is blog.csdn.net.unix21, in fact, it is in the SRC directory to create a folder blog , and then create another folder in the other sequence:
5). New Class
Right-click the package that you just created, New--class, and create a new class.
Fill in the class name, tick the check box (public static void main (string[] args), is to automatically generate the main method , click "Finish" to complete.
The class file has been built.
6). Write code
Add the following code:
[Java]View PlainCopy
- system.out.println ( "hello world by http://blog.csdn.net/unix21"
7). Compile 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 program compiles successfully, output the results in the console window.
Note:
Sometimes it is necessary to check that the installation environment of the JDK is consistent with the eclipse environment.
1. after opening eclipse, window-->preferences-->java-->installed JREs. See if the path is the same as the JDK path we installed.
2. change the Java compiler version of Eclipse to Maximum, in Window-->preferences-->java-->compiler.
3 in order to prevent in the future development, appear to play a space but become a small black dot what strange elephant, put eclipse, unfold Window-->preferences-->general-->editors-->text Editors remove the hook from the front of the show whitespace characters.
Create a Java project using eclipse