idea Guide - Basic Configuration:
Video link: https://www.bilibili.com/video/av21735428/?p=1
idea to install:
- Shortcut create destop shortcut:
32-bit launcher jdk1.7
64-bit launcher jdk1.8
create associations
Not recommended to check, check after starting to open these files need to start the idea
basic configuration
Set width font:
editor -- font -- 勾选 show only monospaced fonts
Console settings:
editor -- color scheme -- console font
Specify the file encoding:
editor -- file encodings
Note: Check the back of the property file Transparen navive-to-ascii conversion
If you do not check in the configuration file will appear as the Chinese ASCII code, rather than Chinese
Scroll the mouse wheel to change the font size
editor - General
勾选 Change font size (Zoom) with Ctrl+Mouse Wheel
Show Line Numbers
editor -- general -- appearance
show line numbers
The method of spacing between the horizontal lines as there
editor -- general -- appearance
show method separators
Formatting code
editor -- code style -- java -- blank lines
keep maximum blank lines are set to 1
Automatically prompt
editor -- general -- codecompletion
Automatic guide packet
editor -- general -- auto import
Set the java: insert imports pastes: all
勾选:add unambiguous imports on the fly
勾选:optimize imports on the fly (for current project)
The mouse was suspended in the class, the methods, the display prompts the document:
(Prompt information when the mouse is moved to the method)> General, search show, then check the Show quick documentation on mouse move - Open file -> setting -> Editor
Set to open multiple files and branches display?
Window→Editor Tabs→Tabs Placement→ 取消:Show Tabs in Single Row
Set their own open file window
configure - editor - general - editor tabs - tab limit: 30 can be set to
Hidden characters before parameters:
settings - editor - appearance - do not check the show parameter name hints
idea Console Chinese garbled
Idea.vmoptions click to open a file, append -Dfile.encoding = UTF-8 codes
IntelliJ IDEA in the "Run / Debug Configurations", modifying the parameters of the virtual machine "VM options", with the additional content in the content file idea.vmoptions the same, are all -Dfile.encoding = UTF-8
Cancel spell checking, open Settings-> Inspection, cancel the "Spelling"
other settings:
6, turn off auto-save, open Settings-General, the anti-election "Synchronize file on frame activation" and "Save files on frame deactivation". Meanwhile modify unsaved asterisk appears, open the Settings-Editor-> Editor Tabs, hook on "Mark modified tabs with asterisk".
7, open the sequence of detection serialVersionUID, open Settings-> Inspections,
10, useless to hide files, such as IDEA project configuration file ( .iml and .idea), open the Settings-File Types, ignore files and folders added to hide file extensions.
*.iml;.idea;.myeclipse;.project.mymetadata;.settings;
11, code hints case insensitive, open Settings-> Editor-> Code Completion, the "Case sensitive completion" is set to None.
Close the browser cache
Open the Google browser, open the Network option bar F12, and then check the [✅] Disable cache.
Automatic compilation:
Specific steps: Hold down Ctrl + Shift + Alt + / and then into the Registry, check and adjust the delay parameters is automatically compiled.
- compiler.automake.allow.when.app.running -> automatic compilation
- compile.document.save.trigger.delay -> Automatic Updates file
PS: Online Few people mention compile.document.save.trigger.delay it is mainly for the static files such as JS CSS updates, will reduce the delay time, press F5 to refresh the page will be able to see the effect!
Use keyboard shortcuts:
Alt + enter: 1) the leader packet, 2) create variables to the subject
Notes: Ctrl + / single-line comment
Ctrl + shift + / multi-line comments
Ctrl + Alt + T: Add try catch
Alt + insert: add get / set methods
Formatting code: Ctrl + Alt + L
Code templates:
1. Add class comment template
settings -- editor -- file and code templates -- include -- file header
/**
@Author: 张世罡
@Date: ${DATE}
@Description: ${PACKAGE_NAME}
@version: 1.0
*/
2.添加方法注释模板
settings -- editor -- live template -- myGroup
/**
功能描述
@param: $param$
@return: $return$
@author: $user$
@date:$date$ $time$
*/
idea interface:
Show Toolbar
view -- toolbar
Display in the sidebar
view -- tool buttons
JVM configuration parameters
help -- edit custom vm options
-Xms1024m
-Xmx2048m
-XX:ReservedCodeCacheSize=500m
After setting the idea will greatly enhance the speed of response
Global settings carried out in two ways:
idea Welcome screen: welcome to intelliJ IDEA - configure - settings
Enter the main interface: file - close project
file -- other settings -- settings for new projects
Note: In the main interface file - setting will only take effect for the current project under settins, do not recommend this approach
Debug using:
- F7 Step into: the implementation of the method call, enter internal methods
- F8 Step over: the implementation of the method call, the method skips
- F9 jump directly to the next breakpoint
Using the idea to create a web project
每次打开都是上一个工程,怎么给他关掉呢?
fle -- close Project -- configure -- settings -- Appearance & Behavior -- System Settings
startup/Shutdown下:
不勾选 Reopen last project on startup
New web project:
create new project -- java -- web application
Select the java EE version will have a corresponding servlet version.
Deploy web project
Edit configuration -- +号 -- Tomcat server -- local
1) Specify the server name
2)Error:Application Server not specified
Services not specified
Select the path to the Tomcat
3)Error:No artifacts marked for deployment
Deployment projects not specified
Click to fix repair
open browser
after launch your favorite browser and select the check, you can start the service after
Configuration files can be automatically loaded the following two changes, from the server is restarted, save time
on 'update' action : redeploy
on frame deactivation : update classes and resources
Add third-party reliance as a web project:
Created under the lib folder under the WEB-INF, lib directory to copy gson
(First copied into the gson API can not be used, the need for some configurations)
Click on the menu bar icon project structure
Select libraries - + number - java - find lib folder - OK - OK - Apply
Select Module can see the lib folder has been added to the inside of the dependence of the current project
Check lib entry into force, you can now use the gson in the project
Create a servlet:
New HelloServlet
Found Httpservlet not imported package
Adding Tomcat environment: selected item - click the icon project structure - module - Dependencies - + number - select Tomcat - add selected - Check the Tomcat - OK
Run Tomcat access path servle-mapping is to
Maven configuration:
configure -- build,execution,deployment -- build tools -- maven
We need to modify three elements:
maven home directory:
user settings file
local repository
Create a project using Maven JavaSE
create new project - maven - Select create from archetype - choose to have the quickstart skeleton - complete set
After the project opens click on the bottom right corner of the Enable-Auto-Import
Using Maven to create a Java web project
create new project - maven - Select create from archetype - choose to have the webapp framework - complete set
After the project opens click on the bottom right corner of the Enable-Auto-Import
Found directory is incomplete:
Creating java in the main folder, resource folder
Right-java folder - mark directory as - sources root
Right-resource folder - mark directory as - resources root
Use maven release engineering:
1. Add the Tomcat plug-in the current project? ? ? ? ?
pom file, add the plugin
2. Use the Tomcat web publishing project
Use maven create an aggregate project
create new project - backbone selected site
Reception engineering and engineering background to create skeleton are selected site: Right-click on the mall project name - new - module - Select the site framework - the next step: to add as module to read none - setting sub-path and save the parent module in the same path - fill in the project name for the portal or back
Note: The add as module to be changed so that none is affected by the parent module management sub-module, but not inherit mall
Front, back sub-module of three sub-modules
A packaging: jar / jar / war
Creating ways: quickstart / quickstart / webapp
Note: dao, service layer quickstart way to create, web layer to create a webapp way
Add dao layer depend on the service layer, the service layer is added in the web layer dependent
web layer folder is incomplete, you need to create java, resources directory, and marks
svn project management
git project management
DeBug
Tip a cross to enter debug mode when intellij break point
View crosses information display No executable code found at line 39 in class package name. Class name,
my line is a line of java code