idea使用總結

1、Intellij IDEA啓動時怎麼選擇項目?

按下【Ctrl+Alt+S】,在設置界面選擇【System Settings】,把右邊面版中Reopen last project on startup前面的勾去掉,保存。


2、tomcat啓動的情況下,修改了jsp文件,怎麼熱部署jsp文件?

 Intellij IDEA默認文件是自動保存的,但是手頭有個項目jsp文件改動後,在tomcat中不能立即響應變化。要jsp文件改動後立刻看到變化,有個配置。
  在idea tomcat 中server的配置裏,有個on frame deactivation,選擇update classes and resources。另外有個配置on update action,就是手動操作的時候採取什麼動作,可以重啓服務器,也可以像上面一樣更新類和資源文件,我選的是Redeploy。 可是當前項目沒有update classes and resources這個選項,有個Hot Swap classes。
  這是由於服務器添加的Artifact類型問題,一般一個module對應兩種類型的Artifact,一種是war,一種是war explored。
  war就是已war包形式發佈,當前項目是這種形式,在這種形式下on frame deactivation配置沒有update classes and resources選項。war explored是發佈文件目錄,選擇這種形式,on frame deactivation中就出現update classes and resources選項了。


3、intellij idea 註釋行如何自動縮進?

進入 Settings -> Code Style -> Java ,在右邊選擇 “Code Generation” Tab,然後找到 Comment Code 那塊,把 【Line comment at first column】、【Block comment at first column】兩個前面的複選框去掉就可以了。

4、執行 archetype:generate 的時候,會產生[INFO] Generating project in Batch mode,然後就一直阻塞在這裏?
原因是:網速問題,如何在idea裏設置maven參數:


5、IDEA調試Android應用,提示

Cannot debug application xx.xxx.xxx.app on device huawei-huawei_g7_tl00.
This application does not have the debuggable attribute enabled in its manifest.
If you have manually set it in the manifest, then remove it and let the IDE automatically assign it.
If you are using Gradle, make sure that your current variant is debuggable.

提示比較明顯,要設置debuggable開關,但忘了在哪個標籤內了。。GG

解決:<application android:debuggable="true"></application>
加上以後AndroidManifest.xml會有紅線提示,release版本時刪掉

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章