In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the use of IntelliJ IDEA". In daily operation, I believe many people have doubts about the use of IntelliJ IDEA. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about "what is the use of IntelliJ IDEA?" Next, please follow the editor to study!
00. Commonly used shortcut
Ctrl+Shift+N or Ctrl+N global search to find a file name in the project
Ctrl+Shift+R global search for files that contain a keyword in the replacement project
Ctrl+Shift+V calls up the contents of the history pasteboard
Ctrl+E to view recently opened files
Ctrl+N-- > navicate to find class files
Ctrl+R current file find replacement content
Ctrl+F file content keyword search (such as finding the setAge keyword in the current file)
Ctrl+o method override
Ctrl+i method implementation
Quick generation of Ctrl+J code blocks
Ctrl+w code block selection
Ctrl+D copies the code block to the end of the block
Ctrl+D also has the ability to compare directories when the cursor is over the project directory
It is equivalent to the integration of the IntelliJ tool with the Beyond Compare tool
Ctrl+Q View document
Ctrl+f12 View File structure
Ctrl+Alt+L code formatting
Ctrl+Alt+S opens the settings window
Alt+Shift+Insert column selection programming
Alt+Shift+C finds recently modified files
Alt+Shift+Enter code blocks automatically generate if,try,do
Press and hold the Alt+ mouse to make column selection
Ctrl+Alt+shift+U class inheritance diagram
Ctrl+F12 query all methods in the class
Debug shortcut key
F8 step in
F9 end breakpoint mode
0, version
IntelliJ IDEA (Ultimate) 2020.1.1
Installation method
Https://my.oschina.net/guiguketang/blog/4674567
1. Project management
Delete an open project
2. Delete Module
Select Project-> right-click-> Remove Module
3. Use of git
3-1. Download the client after installation, the editor will automatically recognize
Https://git-scm.com/download/win
3-2. Import the project through the git address
Get from Version Control
For the first time, you need to install the git client and configure it on the client side
Configure- > setting
3-3. Git account modification
The individual has a github account, and the tool uses the github official website account commit to pass the code.
The company code is also managed by git. When you switch to the company project, submit the code and display the github account of your own extranet in the company code warehouse instead of the account created by the company code warehouse.
This may be a small bug of the IntelliJ editor git plug-in.
If the solution does not take effect, follow Article 6 below.
3-4. Modify git user information (username and mailbox)
View configuration
Git config-global-list
Modify user information
Git config-global user.name "username"
Git config-global user.email "email"
3-5. Git rollback operation
Git reset-soft 5aa322cfa683a3188090c0bcce2ed6c196fc7285
Git push origin HEAD-force
There will be a permission problem. Just turn off the protected permission of the branch where the content of the desired push is located, and log in to the system to modify it.
Settings- > Protected Branches- > Unprotected can execute the above command
After the operation, the remote repository has been rolled back to the desired node.
3-6. Rollback commands checkout, reset
Checkout rolls back code in the workspace
Git checkout-- a.txt # rollback the specified file
Git checkout. # Roll back all files
Reset rollback cache, local warehouse, remote warehouse code
Roll back the code in the cache (the content of the workspace will not change, the code will only add to the cache, no commit to the local warehouse)
Git reset HEAD. # roll back all the contents of add to the cache
Git reset HEAD a.txt # rollback the cache specified file
Reset rolls back the code in the local warehouse (the code has not been push to the remote warehouse, it is only submitted to the local warehouse in a rollback way)
Git reset-- hard # go back to one of the versions you want
Git reset-- hard head ^ # returns to the latest submission
Git reset head ^ # keep the code at this time, go back to before git add
Real fuck
Git add reset_commit.txt
Git commit reset_commit.txt-m "this file will commit to local lib"
Git add reset_commit1.txt
Git commit reset_commit1.txt-m "commit1 again"
Git log
Git reset-hard e5416364ca99a4bb1606bf117dbb23800890824a
And finally went back to the specified version.
Roll back the code in the remote warehouse
Git reset-hard
Git push origin HEAD-force # forcibly submit once, and the previous incorrect submission will be deleted from the remote warehouse
Additional instructions
Using git revert is to roll back the commit before using a new commit.
Git log # get the commit id that you need to return a submission
Git revert # undo the specified version, and the undo will be saved as a submission
-git revert uses a new commit to roll back the previous commit, and the commit before this submission will be retained
-git reset is returned to a certain submission. Both the submission and the previous commit will be retained, but all changes made after this commit id will be deleted.
View the git branch tree:
Gitk-all
3-7.git submit code to exclude exception configuration
Modify the .gitignore file under the root of the project
# Created by .engineer support plugin (hsz.mobi) # Example user template template### Example user template# IntelliJ project files.idea*.imloutgen### Java template# Compiled class file*.class# Log file*.log# BlueJ files*.ctxt# Mobile Tools for Java (J2ME). Mtj.tmp/# Package Files # * .jar * .war * .nar * .ear * .zip * .tar.gz * .rar # virtual machine crash logs See http://www.java.com/en/download/help/error_hotspot.xmlhs_err_pid*targetdistnode_modules
3-8.IntelliJ github shared by newly created projects
Https://my.oschina.net/guiguketang/blog/4483939
4.svn configuration
5. Configure maven in idea:
5-1. Configuration
Click [File] > [Settings] > search [Maven]
5-2. Maven configuration takes effect globally
After configuring the maven environment through 12, each time you create a new project, the configuration returns to the default. The solution is as follows
Once configured, rebuild the project and load the maven environment that you just configured.
5-3. Use the mvn command to load the specified jar package into the local computer repository (very important, must be mastered)
Mvn install:install-file-Dfile=commons-discovery-0.2.jar-DgroupId=com.commons.discovery-DartifactId=commons-discovery-Dversion=0.2-Dpackaging=jar
Code snippet in pom.xml
Com.commons.discovery commons-discovery 0.2
6. The project window in IDEA does not display the project catalogue.
The .idea directory file is damaged. Delete the .dea directory under the project and restart the idea tool.
7.java project
7-1. Start memory parameter configuration
For microservice development, there are many projects that need to be started, including gateways, registries, authorization centers, etc., in addition to the subject project, if the project is separated from the front and back ends.
At the same time, the front-end service needs to be started, which takes up too much memory and computer resources.
The work efficiency of the computer is greatly reduced, and the resources occupied by the project can be reduced by configuring the Vm options property, so as to improve the work efficiency of the editor.
7-2.spring cloud project services console display
View- > tools-services
8. Configuration of the tool itself
8-1. Background settin
File-Settings-Editor-Color Scheme
8-2. Encoding settin
Solve Chinese garbled code
File= > Settings= > Editor= > File Encodings
8-3.IDEA sets window label wrapping display
Windows-> editor tabs-> Configure Editor Tabs- > just turn off show tabs in one row
9.debug operation instructions
> Show Execution Point (Alt + F10): if your cursor is on another line or page, click this button to jump to the current line of code execution.
> Step Over (F8): step by step and go down line by line. If there is a method in this line, it will not enter the method.
> Step Into (F7): step in. If there is a method in the current line, you can enter the method inside the method. It is generally used to enter the custom method, but not the official class library, such as the put method in line 25.
> Force Step Into (Alt + Shift + F7): force entry. You can enter any method. You can use this method to enter the official class library when viewing the underlying source code.
> Step Out (Shift + F8): step out and exit from the inbound method to the method call. At this time, the method has been executed, but the assignment has not been completed.
> Drop Frame (none by default): return the breakpoint, which is described in the following chapters.
> Run to Cursor (Alt + F9): run to the cursor, you can locate the cursor to the line you need to view, and then use this feature, the code will run to the cursor line without the need for a break point.
> Evaluate Expression (Alt + F8): evaluate expressions and dynamically view the values of objects or variables
10. Coding is fast
11-1. Main method psvm
Public static void main (String args []) {
}
11. Configure tomcat data sources
According to the online method, the configuration was not successful. Finally, I configured the data source directly in the conf/context.xml file under the tomcat directory.
For details, see another blog post.
Https://my.oschina.net/guiguketang/blog/5026902
12. Practical problems
12-1. Java project run mode starts successfully; debug mode cannot be started.
Based on the phenomenon, it can be concluded that it is not the code problem; the reason is that there is a breakpoint on the method name.
The shortcut key ctrl+shift+f8 opens the breakpoint panel and finds that there is really a breakpoint on the method name. After removing the breakpoint, the breakpoint is successfully started in debug mode.
12-2. Idea needs to restart tomcat every time you modify jsp
The problem can be solved by configuring according to the figure below.
With regard to the configuration instructions, this blog post makes a detailed interpretation.
Http://www.mamicode.com/info-detail-1699044.html
13. Plug-in MyBatisX
Mybatisplus implementation class method jumps to concrete sql plug-in
14. Conversion from ordinary java project to maven project
Step1: add a new pom.xml file to the root of the project
Step2: file-> right-click-> Add as Maven Project
At this point, the study on "what is the use of IntelliJ IDEA" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.