Nine build path (1) Concept of construction
build: Compile, test, package, and generate documentation for the project. The build of Java projects in Eclipse is generally only compiled. Default Condition
is built automatically, On the menu bar, find Project, in the drop-down list there is a build automatically, which precedes is selected by default, which is
Built automatically.
(2) The concept of building a path
Build path: Project source code, jar files, and so on will be looked up from this path when the projects are built.
In the demo project name, right-click on the drop-down list to find the build path, select it to find the Configure Build path option, click Enter
Enter the Properties for Demo dialog box and select some of these actions to make the build Path.
(3) configuration of the build path
1) Source code folder
2) Jar file
3) Library
Right click on the name of the demo project to create a new folder named Lib, we can copy the MySQL JDBC driver to this folder,
On the drive JAR file right click on Find build Path, and then find the add to Build path This option click, then see this demo project under many
A reference to MySQL's JDBC driver Library, which is the way we recommend it.
(4) Common mistakes
1) Manually delete the jar file under the build path
2) Error building path when importing project
(5) Related source code
Purpose: To gain an insight into the internal implementation of the API in the JDK or to learn the implementation of an open source package.
We add a member variable s that creates a string type in the parent class we created earlier, we select string, press F3, and we can associate to the
The source code for the string class.
10 Local History (1) The concept of local historical records
In Eclipse, the historical version of each file is recorded locally for a period of time (by default, 7 days).
(2) related configuration
1) time the history was saved
2) Maximum save entry for each file
3) Maximum file size
Locate the window in the menu bar, select Preferences in the drop-down list, go to the Preferences dialog box, and under the General tab, find
Workspace, continue to find local history.
(3) Usage Scenarios 1) Retrieve deleted files
If we delete the Demo.xml file under the demo project, we can restore it using local history, right click on the demo project to find
To restore from the Local History option, click into the Restore from local History dialog, we find the deleted demo.xml file,
Click the Restore button.
2) compare different versions of files
We can view the historical version of the parent class under the demo project, and we'll right-click on the Parent.java source file to find the compare with.
Item, then find the Local History option, click Open, there will be a lot of historical version, double-click on a version will appear the current version and selected history
Version of the comparison, see what is different.
3) Replace file to historical version
This is also the case after the comparison, and sometimes it may be changed after the error, then a historical version is correct, which requires me
Change to the historical version, or right-click on the Parent.java file to find the Replace with this option, and then find the local history
Entry, click Enter to the Compare dialog box, select a recent correct version of the history, click Replace.
11 Bookmarks and Tasks tab (1) The concept and settings of bookmarks Bookmark: Used to record a line of code to facilitate the management and positioning of code.
Operation:
We open the MyUser class, select the line number before a line of code, right click to find the Add bookmark entry, click to enter the Add Bookmark dialog
box, fill in the name of the bookmark, click OK. If we set a lot of bookmarks, we can find a drop-down list of Windows in the menu bar
In the Show view option, and then find the Bookmarks option, a list of bookmarks appears. We can make the relevant changes and set the properties
and a bookmark description.
(2) The concept and setting of task bookmarks Task Tag: A special kind of annotation that helps improve development efficiency and code management.
Built:
TODO: Refers to a feature that needs to be implemented here.
Fixme: This is usually referred to as a logical error or an exception, pending processing.
XXX: Generally referred to here, the function has been realized, but to be optimized, to be open to question.
Operation:
1) TODO
After we close all the code, we find the Show view option in the drop-down list of the window on the menu bar and find the tasks
Item, click on the Tasks list will appear. Select a location where the source code will be located, we can continue processing, complete the code.
2) fixme
To do the same, we locate the location to be processed, modify the code and throw exceptions or exception handling.
3) XXX
To do the same, we navigate to the location where optimization is needed and optimize the code.
4) Customizable
We found the preferences option in the dropdown List of window on the menu bar and went to the dialog box to find the compiler under Java.
Task Tags option, we add a custom task label with the low level named error, click OK. Repeat the above operation, I
They are positioned to the wrong location to make changes to the code.
Note that this must be consistent with the uppercase letters that are defined, and if lowercase is used, this situation does not occur.
12 Search Find and replace (1) search Operation 1) Text Search for files
Press Ctrl+h, the Search dialog box appears, find the Java Search tab, we enter the name of the class to query, and whether it is a query declaration or a citation
To use, click Search.
2) search for various syntax elements in Java
Press Ctrl+h, the Search dialog box appears, find the File Search tab, we enter the string to query, and so on, click Search.
3) search for tasks and git 4) Use Ctrl+h to bring up the dialog box
Find search on the menu bar, there are various searches in the drop-down list, also we are more commonly used. See for yourself, you know.
(2) Find Operation
Text Lookup for a file
Use Ctrl+f to bring up a dialog box
(3) Replace operation
Text substitution for a file
13 Navigation (1) The concept of navigation
Navigate: You can quickly locate and open Java classes, interfaces, or methods in eclipse.
(2) Navigation operations in Eclipse 1) Jump
Find navigate on the menu bar, find the go to option in the drop-down list, and then find the relevant action.
In the drop-down list, you can also find the go to line option, open the Go to Lines dialog box, we write the number of rows we want to jump, click OK
Can
There is also the back option in the drop-down list, the next annotation option and the previous annotation option, which are available for jumping
, we will no longer be demonstrating.
2) Open statement
Select String, Find navigate on the menu bar, find the open declaration option in the drop-down list, or press F3 to hit
A declaration that opens a string class.
3) Open type hierarchy
Select RefactoringDemo2, Find navigate on the menu bar, find the open Type hierarchy option in the drop-down list, or you can
You can press F4 to open the type hierarchy of the RefactoringDemo2 class (that is, the inherited parent class or the implemented interface).
4) Open the call stack
We see where the Test2 method is called, select Test2, Find navigate on the menu bar, find the open call in the drop-down list
Hierarchy This option, you can find the hierarchy that calls the Test2 method.
5) Open the implementation
We enter:list<string> names = new arraylist<string> () in the Code, Names.add ("Java"), check the Add method name,
Find the navigate on the single bar, find the open implementation option in the drop-down list, and the implementation of the Add method will appear.
6) Open the parent class implementation
Check the test method, find navigate on the menu bar, find the open Super implementation option in the drop-down list,
bit to the implementation of the parent class.
7) Open Resources
On the menu bar, locate navigate, and in the drop-down list, locate the open source option, which opens the enter into the Open Source dialog box.
8) bread crumbs
In the parent class editor, right-click to find the show in breadcrumb option, open will display a hierarchical lookup of the parent class at the top of the editor
The hierarchy.
Go to Eclipse Development tools (vi)