Eclipse Installation and use

Source: Internet
Author: User

Installation of 1:eclipse

2: Write a HelloWorld case with Eclipse and finally output your name on the console

A: Create A Project
B: Create the package in the SRC directory. Cn.itcast
C: Create the class under the Cn.itcast package. HelloWorld
D: There is a method under the HelloWorld. public static void Main (string[] args) {}
E: There is an output statement in the main method. System.out.println ("Your Name");

Basic configuration of 3: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
Select the content you do not want and edit it by editing it on the right.
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

4: 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 the class name (F3 or CTRL + mouse click)

5: 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.

6: Through the explanation of the shortcut keys and improve the development efficiency of some content to complete the following content
Custom Student class: Student
member variables;
Name
Age
Construction Method:
No reference
With reference
Member Methods:
GetXxx ()/setxxx ()
Gives a show () method that displays all the member information for the class.

Then, write a test class to test the student's code.
Studentdemo

7: Delete Project and import 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, expand, and find
Existing Projects into Workspace
Click Next, then select the item you want to import
Note: The project name is selected here

8: A few small issues 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>

9: Everyone takes note of the document
A: Create a folder specifically for receiving items, and do not place them arbitrarily.
B: When the same project is received again, first go to the storage directory to delete the original item, then re-store, and finally refresh the project.
C: Every day against the project I write, I also create a practice project
Example: my project name Day11_eclipse
You'll create a project name Day11_eclipse_test

Advanced (Debug) debugging of code in 10: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 the F6, or click also can. 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.

Eclipse Installation and use

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.