1. 程式人生 > >idea常規設置

idea常規設置

lin 隱藏 最新版 target esc prop val src XML

java開發目前很多都是使用IntelliJ IDEA這款神器。廢話不多說,官網地址:https://www.jetbrains.com/idea/ 我一直都是保持最新版本,安裝之後註冊。

首先需要安裝幾款常用的plugins。ctrl+alt+s 打開設置頁面,找到plugins,在裏面搜索以下插件:
Lombok Plugin
Alibaba Java Coding Guidelines

.bash文件擴展
.log文件擴展
.sh文件擴展
.cmd文件擴展
.md文件擴展

在Version Controller中配置git

在Edit > File Types中設置隱藏不必要的文件夾(

隱藏:在 Ignore files and folders中添加想要過濾的文件或文件夾名稱

展示隱藏文件: 在過濾列表中刪除掉文件或者文件夾就好了

技術分享圖片

在Edit > font中設置字體 18 空格1.1

技術分享圖片

在Appearance & Behavior > Appearance 設置界面字體大小設置,字號默認為:12

技術分享圖片

Editor->File Encoding設置項目默認編碼

技術分享圖片

Editor->General->Code Completion讓代碼提示不區分大小寫

技術分享圖片

修改自己習慣的Keymap快捷鍵

技術分享圖片

在Editor > General > Auto Import 設置 enable auto import
技術分享圖片

Editor > Build,Execution,Deployment > Compiler 設置代碼自動編譯:

技術分享圖片

在File > Project Structure 中配置java版本 或者 ctrl + shift + alt + s



在初期配置之後開發過程中可能如下幾個問題,我也是從網上找到,過來記錄總結下:

1:Intellij IDEA運行報Command line is too long解法

報錯內容:

Error running ‘ServiceStarter‘: Command line is too long. Shorten command line for ServiceStarter or also for Application default configuration.

解法:

修改項目下 .idea\workspace.xml,找到標簽 <component name="PropertiesComponent"> , 在標簽裏加一行 <property name="dynamic.classpath" value="true" />

參考地址:https://blog.csdn.net/ZXJ_1223/article/details/80611089

2:IntelliJ Idea取消Could not autowire. No beans of ‘xxxx‘ type found的錯誤提示

在Idea的spring工程裏,經常會遇到Could not autowire. No beans of ‘xxxx‘ type found的錯誤提示。但程序的編譯和運行都是沒有問題的,這個錯誤提示並不會產生影響。但紅色的錯誤提示在有些有強迫癥的程序員眼裏,多多少少有些不太舒服。

技術分享圖片

解決方案

技術分享圖片

參考網址:https://www.cnblogs.com/waterystone/p/6214212.html

3:spring boot+mybatis+idea,sql語句使用註解方式,沒有XXmapper.xml文件。XXDao對象有紅色報錯,提示Could not autowire。

在IDEA中安裝了【iBATIS/MyBatis mini-plugin】解決

未完待續,遇到再總結

idea常規設置