Common usage notes for Java development tools--eclipse

Source: Internet
Author: User

Common tools for Java development are:

A: Notepad software comes with the operating system

B: Advanced Notepad software

C: IDE for integrated development Environment

(Integrated development environment)

Basic uses of Eclipse are basic :

Select a work space

working Space is actually the directory where we wrote the source code.

with Eclipse to complete a HelloWorld case

Code with project as base unit

Create a project

Create a Package

Create Class

Writing code

Eclipse's Localization and inspection:

Installing plug-ins with Dropins

Starting from Eclipse3.5, there is a dropins directory under the installation directory, just unzip the plugin and put it in the directory. Similarly, uninstalling plug-ins in this way is also particularly convenient, recommended this way

You can also use the Chinese and English versions, so you can learn English

Source code Syntax Check

Wavy Red Line

Yellow wavy Line

Windows and views that eclipse consists of:

Windows each basic form is called a window

Packageexplorer display project structure, packages, classes, and resources

Outline display the structure of the class, easy to find, identify, modify

The result of the Console program running is displayed in the window

Problems Show all syntax and error locations

Hierarchy Displays the Java inheritance hierarchy, with the class selected F4

Views are made up of a combination of some windows. Example

Java view

Debug view

Basic configuration of Eclipse space :

A: program Compilation and operation of the Environment configuration ( generally do not change )

Window--Preferences--Java

Compilation Environment: Compiler The highest version is selected by default.

Operating Environment: Installed JREs will find the JDK you installed by default . We recommend that you configure the environment variables for Java.

Problem:

Low compile, high run. OK.

High compilation, Low run. No.

It is recommended that you compile and run the same version.

B: How do I get rid of the default annotations ?

Window--Preferences--Java--code Style--code Templates

Choose what you don't want, by the right Edit.

Note: Please delete only the comments section, not the comments section.

C: display and hide of line numbers

display: In the left-most blank area of the code area, right -show line Numbers .

Hide: Do the above action again.

D: font size and color

A:java the font size and color of the code area:

Window--Preferences--general--appearance--Colors and Fonts--Java Modify --Java edit Text Font

B: Console

Window--Preferences--general--appearance--Colors and Fonts--Debug--Console font

C: Other documents

Window--Preferences--general--appearance--Colors and Fonts--Basic--Text Font

E: The form to mess up, how to do ?

Window--Reset perspective

F: The console can't find it, what should I do ?

Window--show View-console

Common shortcut keys :

A: formatted ctrl+shift+f

B: Import Package Ctrl+shift+o

If the class is in only one package, it shows itself

If the class is in more than one package, a box will pop up for you to choose

C: Comments

Single line: Comment ctrl+/, uncomment again.

Multiple lines:ctrl+shift+/,ctrl+shift+

D: code moves up and down

Select Code ALT + up / down ARROW

E: View the source code

Check class name (F3 or Ctrl + mouse click )

How to improve development efficiency

A: automatic generation of construction methods

A: non-parametric construction method right---source--generate constructors from superclass in the code area

B: with the parameter construction method in the code area right-click --source--generate constructors using fields. --Finish

B: auto-Generate getXxx ()/setxxx () method

Right---source--generate Getters and Setters in the code area ...

Provides the corresponding shortcut key operation.

Alt+shift+s

Press the letter with an underscore.

C: How to inherit an abstract class and implement an interface.

the role of D:override

Indicates that the method is overriding the parent class. If the method declaration and the parent class do not match, an error is made.

To delete a project and import a project:

Delete Item

Select Item – Right-click – Delete

Remove from Project area

Remove from hard disk

Import Project

Right-click in the project area to find the import

Find General, unfold, and find

Existing Projects into Workspace

Click Next, then select the item you want to import

Note: The project name is selected here

A few small questions to note

How to view the path of a project

Select -- right ---Properties--Resource--Location

Issues to be aware of when importing projects

items with the same name cannot appear in the project area ( new or imported )

A folder that you arbitrarily create is not imported as a project.

Modify Project Issues

Do not arbitrarily modify the project name

If you really want to modify it, don't forget the configuration file .

<name> change this to the name you changed after </name>

Advanced (Debug) debugging of code in Eclipse

Role:

Debug program

View program Execution Flow

How to view the program execution process

To see the program flow, you must set breakpoints.

What is a breakpoint:

is a marker, where to start.

How to set Breakpoints:

Where you want to see the program, you just double-click on the left side of the active program.

Where to set breakpoints:

where not to point.

Currently: we add on the first valid statement of each method.

How to run a program after you set a breakpoint:

right --Debug as--Java application

See which places:

Debug: Where to test breakpoints

in this place, remember F6, or you can click on it. See the execution of a row at a time.

Variables: Viewing variable variations of a program

Fordemo: The source file being viewed

Console: Consoles

How to go to breakpoints:

A: double-click again

B: find the Debug view,Variables interface, find breakpoints, and click, then see all the breakpoints, and finally click on that double fork.

 

Common usage notes for Java development tools--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.