Create a Java project using eclipse

Source: Internet
Author: User

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 
    1. 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

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.