Tips for using eclipse

1. The alt+/ key will generate a word prompt, which can improve the programming speed .

For example, you don’t need to work hard to type: System.out.println(); the whole sentence, just enter syso in eclipse, and then hold down ALT+/, System.out.println();

In the case where the alt key + / does not work, the following methods can be used to set:

1. The method is used when there is no prompt:

Open preferences (preferences, preferences) on eclipse → java → editor (editing) → content assist (content assistant, content assistance), there is a line "select the proposal kinds contained in the 'default' content assist list" on the upper right (select Under the "Default" content assist list (Suggestion type option), check the Java Prolosals check box, save and exit.

2. This method is used to type the abbreviation without prompt

[For example: there is no prompt when typing syso (the word means system in Chinese)]: preferences →java→editor→ content assist, find the item "Auto activation triggers for java:" (java's automatic activation trigger), followed by a text box, enter the letter abcd in the text box behind, then click appplay-->OK to save and exit,

Select Export File → General → Export, select preferences, and then select the Export all check box (the following does not need to be controlled), and specify the name and path of the export file (note that only files in .epf format can be exported). Then find the epf file you just exported under the path you specified, open it (you can use Notepad), find the abcd (or abc) you just entered, and add the rest of the 22 English letters after it, save it, Then use the import function of eclipse to import the file into eclipse, and then the word association prompt function can be realized.

3. Preferences → General (general) → Keys (key, there is a search box under Scheme (plan/system), enter "Content asist" in the search box (my Eclipse cannot enter in this search box, the following The button seized the focus, so I chose to copy and paste, pay attention to capitalization when searching), after selecting the "Content asist" item, change the Binding (data constraint/binding) item to "ALT+/" (press " /" key to change), select the When item as Editing Text.

2. Create the first java project on Eclipse:

  1. file➞New➞Java project→Input the project name, (without .java) and go all the way down, no need to click other places➞ Don’t create the moble name, a new project is created, and the folder contains only one src file.

  1. Create package. There are many packages to be created in a project. Right click on src→package (the package name is all in lowercase. The package name is usually composed of several identifiers, separated by dots (.), and the first identifier often indicates the domain name)→Enter the name, a package and you are done.

// src is a folder dedicated to java source code

As follows, it is a Datebase project, which contains a Datebase package, and there is a class in the package.

  1. Create classes. Right-click on the package name → select class, enter the name to create a new class, naming convention: the first letter is capitalized, no need to write .java, it will be automatically generated.

It is recommended to check public static void main, the main method will be generated directly, no need to type it by yourself.

(The ones created above do not need to bring .java),

Then you can start typing code.

Third, don't forget to configure the jdk environment.

Java runs in the jdk environment, which ensures that the same source file (bytecode file) can run under the Windows system, macOS system, or Linux system.

jdk includes the JRE operating environment. The most important thing about the JRE operating environment is to have a virtual machine, so it can run in various systems, thus ensuring Java to achieve cross-platform.

Guess you like

Origin blog.csdn.net/weixin_48060069/article/details/129092775