The Java Learning Eclipse development tool

Source: Internet
Author: User

Eclipse is a powerful Java integrated development tool. It can greatly improve the efficiency of our development. You can automatically compile and check for errors. In the company, Eclipse is used for development.

1.1 Eclipse Download, install, uninstall

L Download http://www.eclipse.org

L installation (can be used only after decompression)

L Uninstall (only need to delete the folder to be able to)

Note: In the installation directory of the development software, try not to appear spaces with Chinese

1.2 Use of Eclipse

In the current phase, we only need to complete the most basic Java file writing, other functions follow the daily teaching slowly infiltration learning.

Steps to use:

L 1. Open, select a workspace, such as

N Workspace: Refers to the location where the Java source files will be written in the future

The check box "-" In N, if selected, indicates that the default workspace for Eclipse is used for the current workspace, and when you start eclipse later, you are not prompted to select a workspace.

Figure 1-1 Choosing a working space

L 2. Right-click on the left margin or select the File menu bar, select New--> to create the Java project name, and tap finish. As

Figure 1-2 Creating a Java Project

L 3. Expand the project, select the source package src, right-click on the project's SRC directory to create the class, specify the class name Hello, create the main method and write the source code System.out.println ("HelloWorld");

Figure 1-3 Creating a class

L 4. Compiling and executing

N Compile: Auto compile, automatically compile class file when Java code is saved

N Execution:

U Mode 1: Click the green with Triangle Run button in the menu toolbar

U Mode 2: Click Run in the menu bar, click the running shortcut key is CTRL+F11

U mode 3: Select the Java file you want to run, or in a blank area of your code, right-click Run as--running Java program

1.3 Simple configuration for Eclipse space

L Program compilation Environment and operating environment

N Compilation Environment: Window--Preferences–java-compiler

N Operating Environment: Window--preferences–java-installed JREs

Figure 1-4 Compiling environment and running environment configuration

How to display line numbers and hidden line numbers

N Display: In the left blank area of the code area, right--show line Numbers

N Hide: To do the above operation again

Figure 1-5 Line number display and hide

l How to change font size and color

n Modifying the font size and color of Java code

U Window--Preferences--general--appearance--Colors and Fonts--Java--Java Editor Text font selected, click Edit to Modify

n Modify other font sizes and colors

U Window--Preferences--general--appearance--Colors and Fonts--Bacic--click Edit when Text Font is selected, make changes

Figure 1-6 Setting the font

L Display the window is messed up, restore the default display mode

N window–perspective--Reset prespective

How to remove default annotations

N Window--Preferences--Java--code Style--code Templates--Comments–methods, click Edit, delete the comment section (not recommended)

N Window--Preferences--Java--code Style--code Templates--code-Method body, click Edit to delete the comment section

L Switch Workspace

n file–switch workspace– Specify the workspace –ok

1.4 Shortcut keys

L Content Auxiliary key alt+/

N Auto-Completion Main method main then alt+/

N Auto-Completion output statement SYSO then alt+/

L Format ctrl+shift+f

N Code area right--Source–format

L Automatic Guide pack: Ctrl+shift+o

N if the current class exists in more than one package, use Ctrl+shift+o to select a package import.

L Notes

N Single-line comment

U plus NOTE: First select the content you want to comment on, then ctrl+/

U Uncomment: First select the content you want to uncomment, and then ctrl+/

n Multi-line comments

U plus NOTE: First select the content you want to comment on, then ctrl+shift+/

U Uncomment: First select the content you want to uncomment, and then ctrl+shift+\

1.5 Breakpoint Debugging

L Breakpoint: is a marker

L How to set breakpoints

n the left blank position of the code area double-click

l Where to add

n want to see which statement the execution result is in front of the statement plus

L How to run a breakpoint program

N Code area right--Debug as--Java application

n displays a page that prompts you to enter the Debug page? Do you remember the current operation? Yes (yes) Yes (tick check box)

L Popup Breakpoint Page

n Dot where

U click Step Over in the toolbar (execute next line)

U shortcut key F6 see the execution of each step of the procedure

n See where

U look at the code area: Take care of the procedure steps

U look at the debug area: Take care of the procedure

U look at the varable area: Create, copy, destroy, observe variables

n How to eliminate breakpoints

U put the breakpoint in the way you do it again

U switch to debug view, select Breakpoints--Remove all breakpoints is the 2 x icon

1.6 Deletion of items

L Delete in project area

n Right-click on the specified item in the left Packageexplorer area and tap Delete to delete

L Delete on hard disk

n Right-click on the left Packageexplorer area for the specified item, tap Delete Delete, and select the following to delete on the hard drive (delete project contents on disk)

Figure 1-7 Item Deletion

1.7 Import of items

L Right-click on the Packageexplorer area on the left and select Import

L Select General--Existing Projects to Workspace

L Select, click Next

In the new window, click Browse to find the item you want to import (note that you can find the name of the item), select the item you want to import, click the Copy check box, and click Finish.

L Precautions

n an item of the same name already exists in eclipse cannot be imported again

Figure 1-8 Project Import

The Java Learning Eclipse development tool

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.