1. Use Eclipse to write a HelloWorld
(1) Select the Working space
The workspace is actually the directory where we write the source code.
(2) Create a Java project
"File-new-java Project"
(3) Create a package
"To expand the project, build a package Com.kim under the source bundle SRC"
(4) Create a class
"Create a class HelloWorld under the Com.kim package"
(5) Writing code
(6) Compiling
When you click Save, automatically back to save, under the directory, automatically generate class file
(7) Operation
Three ways to run
Way one, click triangle:
Mode two, shortcut keys:
Mode three, right-click to select:
2. Chinese Grade grammar check
(1) Chinese
Under the Dropins folder, pull into the Chinese package to plug in the way.
(2) Grammar check
The main reason that Eclipse is able to check syntax is because eclipse is always watching for keyboard or mouse output actions
3.Eclipse of Windows and views
(1) Windows
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 Show Java inheritance hierarchy, check class by F4
(2) View
By the combination of some windows
Java windows
Debug windows
Basic configuration of 4.Eclipse space
(1) Environment configuration of program compiling and running
Compilation environment: Window-preferences-java-compiler "Highest version selected by default"
Operating environment: window-preferences-java-installed JREs "The JDK you installed will be found by default."
Problem: Low compile, high run, yes, high compile, low run, error, recommended compile and run version consistent
(2 Remove default comment
Window-preferences-java-code Style-code Templates
(3) display and hiding of line numbers
In the left-most blank area of the code area, right--show line numbers
(4) Font size and color
A:java font size and color for code areas
Window--Preferences--general--appearance--Colors and Fonts--Java Modify--Java edit Text Font
B: Output font style for console
Window--Preferences--general--appearance--Colors and Fonts--Debug--Console font
C: Restore Default
Window--preferences--general-restore Defaults
(5) Form restore default
Window--reset Perspective
(6) The console is missing.
Window--show View-console
5. Shortcut keys
(1) Content assist key
ALT +/Hint action
Main + ALT +/; method + ALT +/
(2) Common use of shortcut keys
A: Formatting: Ctrl + SHIFT + F
B: Import Package: Ctrl + Shift +o
C: Comments
Line comment Ctrl +/;
Block Comment Ctrl +shift +/; Ctrl +shift + \;
D: Code moves up and down: ALT + up \ down arrow
E: View Source: F3 or Ctrl + left mouse button
(3). Shortcut keys to quickly improve the development efficiency
A: Automatic generation of non-parametric construction methods
"ALT + SHIFT + S + C +enter"
B: Automatic generation of parameter construction methods
"ALT + Shift +s +o"
C: Automatic generation of Get/set methods
"ALT + SHIFT + S + R + Tab + ENTER +tab +tab +tab +enter"
D: Inheriting abstract classes
E: Inherit interface
5. Hit the jar pack and use the jar package
(1) What is a jar
Jar is a compressed package of multiple class files
(2) What is the jar used for?
Use what someone else has written.
(3) Playing jar bag
Select Item-Right--export-java-Select path-finish
(4) using the JAR package
Copy to the project's root directory, select the JAR package-right--buidpath-add to Build Path
6. Create a Help document
Select Item-Right--export-java-javadoc-Select path-finish
7. Delete the project and import the project
Delete Item: Select item-Right-delete (remove from project/delete from hard drive)
Import Project: Select Item-Right-click-import-general-existing Projects into Workspace-next
8. View the path of your project
Select Item-Right-click-properties-resource-location
9. Debugging with Eclipse
(1) Setting breakpoints
Double-click in front of the code
(2) Commissioning
A: Select Debug View
B: Start Debugging
C: Press F6 Step by step debugging
Java Series Learning (12)-Start eclipse