IntelliJã§è¤æ°ã®ããã¸ã§ã¯ããéãæ¹æ³
ãã£ããã¯ãã¡ãã®ã¤ã¶ããã
IntelliJã«ã¯Eclipseã®ãã¯ã¼ã¯ã¹ãã¼ã¹ãã¨ãNetBeansã¿ããè¤æ°ã®ããã¸ã§ã¯ããã¾ã¨ãã¦ç®¡çãã¨ãã£ã¦èãæ¹ã¯ç¡ãï¼ãããã¸ã§ã¯ããã¨ããã«é¢é£ãããã¢ã¸ã¥ã¼ã«ãã¨ããèãæ¹ã§ï¼IntelliJã®ã¤ã³ã¹ã¿ã³ã¹ã¯ãããã¸ã§ã¯ããåä½ã«èµ·ããã
File->Open PorjectãReopenã§ããã¸ã§ã¯ããé¸ã¶ã¨ï¼ãããªãã¤ã¢ãã°ã表示ãããã¨æãã
ããã§ãNew Windowããé¸ã¶ã¨ï¼å¥ã®IntelliJã§ããã¸ã§ã¯ããéãã®ã§ï¼çµæçã«è¤æ°ã®ããã¸ã§ã¯ããåæã«è¡¨ç¤ºã§ããããã ï¼IntelliJã®ããã»ã¹ããã®åå¢ããã®ã§ï¼ãã·ã³ã«ã¨ã£ã¦ãããããªãã:-Pã¦ã½ã§ãããããã¸ã§ã¯ããè¤æ°éãã¦ãIntelliJã®ããã»ã¹ã¯ï¼ã¤ã®ã¾ã¾ã§ããã
ã¨ãã£ã¦ãï¼ãããæ®éã ã¨æã£ã¦ããã®ã§ï¼é¢ä¿ç¡ãããã¸ã§ã¯ãã横æãã¦ä½ããããã¨æã£ããã¨ãç¡ãã®ã§ï¼ [twitter:@t_wada] ããã®ã¤ã¶ããã¯ã¡ãã£ã¨æ°é®®ã ã£ãã:-)
ã¡ãªã¿ã«ï¼IntelliJ/Eclipse/NetBeansã®ããã¸ã§ã¯ãã¾ããã®ç¨èªã®éãã¯ä»¥ä¸ã®éã*1ã
IntelliJ | Eclipse | NetBeans |
---|---|---|
Project | workspace | 該å½ç¡ã/ãããã¯Project Group |
Module | Project | Project |
ãã¨ï¼t_wada ãããã¾ã¨ããtogetterã¯ãã¡ãã
â JetBrains 製 IDE (IntelliJ, RubyMine, WebStorm 等) で小さいプロジェクトをたくさん扱うには - Togetter
IntelliJã§ãããªãã¨ãããã¨æã£ã¦ãåºæ¥ãªããï¼ã¨ããã¨ããã§ããªãã¦ï¼ãä¾åé¢ä¿ã®ããã¢ã¸ã¥ã¼ã«ããã¾ã¨ãã¦ãããã¸ã§ã¯ãããä½ããã©ï¼å¥ã«ãä¾åé¢ä¿ãªãã¦ããããã¸ã§ã¯ãä½ãããã ãããã¨ï¼æã£ãã®ã§ï¼å®éã«ããæ¹ã解説ãã¨ãã¾ãã
ã¾ãï¼ãããã¼ãªããã¸ã§ã¯ããä½ã£ã¨ããæ¢åã®ã¢ã¸ã¥ã¼ã«ã®ã¨ãã¾ã¨ãç¨ããã¸ã§ã¯ããªã®ã§ãCreate moduleãã®ãã§ãã¯ã¯å¤ãã¦ï¼ããã¸ã§ã¯ãã ãä½ãã
空ã£ã½ã®ããã¸ã§ã¯ãã¯ï¼ããã¸ã§ã¯ããã£ã¬ã¯ããªã«IntelliJã®ããã¸ã§ã¯ããã¡ã¤ã«ï¼./idea
ãã£ã¬ã¯ããªï¼ãããã ãããããä»ããªã®ã§MacãLinuxããã¯ã±ã£ã¨è¦ç©ºã®ãã£ã¬ã¯ããªã«ããè¦ããªããã¡ãªã¿ã«ï¼IntelliJ以å¤ã®JetBrains製åãããã¸ã§ã¯ããã£ã¬ã¯ããªã«ã¯./idea
ãã£ã¬ã¯ããªãã§ããã¯ãã
ãã¨ã¯ï¼ãã®ããã¸ã§ã¯ãã«ã¾ã¨ãããã¢ã¸ã¥ã¼ã«ãåãè¾¼ããIntelliJã®å ´åã¯ï¼File->Project Structure*2ããã¢ã¸ã¥ã¼ã«ã®è¿½å ãé¸ã³ãImport existing moduleãã§ï¼åãè¾¼ã¿ããã¢ã¸ã¥ã¼ã«ãæå®ãããã¡ãªã¿ã«ï¼ã¢ã¸ã¥ã¼ã«ã£ã¦ã®ã¯*.iml
ãã¡ã¤ã«ã®ãã¨ãã
ãã¨ã¯ï¼åãè¾¼ã¿ããã¢ã¸ã¥ã¼ã«ã®åï¼ãã®ä½æ¥ãç¹°ãè¿ãã ããåãè¾¼ãã ã¢ã¸ã¥ã¼ã«ã¯ï¼ãã¨ãã¨ã©ããã®ããã¸ã§ã¯ãã«å±ãã¦ããã¯ããªã®ã§ï¼åãè¾¼ãã ããã¸ã§ã¯ããã£ã¬ã¯ããªã¯ç¸å¤ããã空ã®ã¾ã¾ã
æ®éã¯ããã¸ã§ã¯ããã£ã¬ã¯ããªã®é ä¸ã«ã¢ã¸ã¥ã¼ã«ãä½ããã ãã©ï¼å®ã®ã¨ããããã¸ã§ã¯ãã¨ã¢ã¸ã¥ã¼ã«ãã©ãã«ãããã¯é¢ä¿ãªãããªã®ã§ï¼ä½æã®ããã¸ã§ã¯ãã®ã¢ã¸ã¥ã¼ã«ãåãè¾¼ã¿ï¼Import existing moduleï¼ã¨è¨ã£ã¦ããã©ï¼ã©ã£ã¡ãè¨ãã¨ãªã³ã¯ã«è¿ãããªã
æ°ãã¤ããäºã¨ãã¦ã¯ï¼åãè¾¼ãã ã¢ã¸ã¥ã¼ã«ã®SDKãåºåãã£ã¬ã¯ããªã¯ãããã¸ã§ã¯ãã®æå®ã«åããããã«ãªã£ã¦ãå ´åï¼ä¸å¹¸ãªçµæã«ãªãäºãããã®ã§ï¼å¿
è¦ã«å¿ãã¦ã¢ã¸ã¥ã¼ã«åå¥ã«è¨å®ãç´ããæ¹ãè¯ãããç¥ããªããæ£ç´ï¼ã¡ãã£ã¨ã¡ã³ãã¤ããã
ã¾ãã¯ï¼åºåå
ï¼å
ã»ã©ã¨åãï¼Project Structureã§è¨å®ããï¼ããã£ã¡ã¯ããã¸ã§ã¯ãä¾åï¼Inherit project compile output pathï¼ã§ãã£ã¦ãï¼ã¢ã¸ã¥ã¼ã«ãã¨ã«åºåå
ãç°ãªãã®ã§ï¼ã»ã£ã¨ãã¦ã大ä¸å¤«ããã
ã¤ã¥ãã¦SDKããProject SDKããæå®ãã¦ããã¨ï¼ããããã¸ã§ã¯ãä¸ã®ã¢ã¸ã¥ã¼ã«ã¯ããã¹ã¦åãSDKã使ããã£ã¦äºã«ãªãã®ã§ï¼ç°ãªãSDKã使ã£ã¦ããã¢ã¸ã¥ã¼ã«ãã¾ã¨ããå ´åã¯ï¼ã¢ã¸ã¥ã¼ã«ãã¨ã«SDKãæå®ãã¨ããªãã¨å¤ãªã¨ã©ã¼ãã§ãããç¥ããªãã
ã¨ï¼ããã ãããã©ãäºããã°Eclipseã®ã¯ã¼ã¯ã¹ãã¼ã¹ã¢ãããIntelliJã§ãä½ããããã ã
ã¡ãªã¿ã«ï¼ã¡ããã¨ä¾åé¢ä¿æããããã¨ãï¼ããã¢ã¸ã¥ã¼ã«ãã©ã¤ãã©ãªã¨ãã¦ããã¸ã§ã¯ãã«åå ããããã¨è¨ã£ãæ¬æ¥ã®ä½¿ãæ¹ã«ã¤ãã¦ã¯ï¼ãã¡ããåç
§ã®ãã¨ã
â IntelliJで他のプロジェクトをライブラリプロジェクトとして読み込む - 仙台 Ruby Vim JavaScript フリーランスプログラマ
ãã¾ãï¼ãã®ï¼
ããã§ã ãããã¾ã§é¢åãããã«ï¼ã¡ããã¨ãã¡ã¤ã«ããã©è¦ãããã ãã ã£ããï¼ããã¸ã§ã¯ãå¤ã®ãã¡ã¤ã«ãIntelliJã®ã¨ãã£ã¿é¨åï¼ä¸å³ã®ãªã¬ã³ã¸æ ï¼ã«ãã©ãã°ï¼ããããããã°ããã
ãã¤ã®ãã¼ã¸ã§ã³ãããã¯å¿ãããã©ï¼ãããªé¢¨ã«ããã¸ã§ã¯ãå¤ã®ãã¡ã¤ã«ãIntelliJã§éãã¦ç·¨éã§ããã
ãããï¼æ¡å¼µåã«å¿ããã·ã³ã¿ãã¯ã¹ãã¤ã©ã¤ããå¹ããï¼Javaã®ãã¡ã¤ã«ã¨ãã ã¨ï¼æ¾ãè¾¼ãã ããã¸ã§ã¯ãã®ã¯ã©ã¹ãã¹ã«å¿ããã³ã¼ãè£å®ã¨ãããã¦ãããããã¨ãã¡ã¤ã«ãéãã£ã±ã«ãã¨ãã°ï¼æ¬¡åãã®ããã¸ã§ã¯ããéããã¨ããï¼ãã®ãã¡ã¤ã«ãè¦ãã¦éãã¦ãããï¼éãã¡ãã£ã¦ãï¼Recent Filesã§ã¾ãéãããã©ï¼ãçµæ§ï¼è³ããå°½ãããã ã£ããããã®ã ã:-)
ãã¨ï¼ä¸ããªã話ã ãã©ï¼IntelliJã®binãã£ã¬ã¯ããª(($IDEA_HOME/bin
ãMac OSã®å ´åï¼$IDEA_HOME/Contents/MacOS
))ã«ãã idea.bat
ã idea
ã³ãã³ãçµç±ã§ããã¡ã¤ã«ãéããã£ã¦ã¤ããããã¯ç¥ã£ã¦ããã©ï¼å®éã«ä½¿ã£ãäºã¯ç¡ãã
ãããªæãã«ãã¡ã¤ã«ãã¹æ¸¡ãã¨ï¼ç¾å¨åãã¦ããIntelliJã®ã¤ã³ã¹ã¿ã³ã¹ï¼ã¨ãã®ããã¸ã§ã¯ãï¼ã«ãã®ãã¡ã¤ã«ãéãã¦ãããã
IntelliJãåãã¦ãªãç¶æ
ã§ã³ãã³ãå©ãã¨ï¼IntelliJãèµ·åãããã©ï¼ããã¸ã§ã¯ãéãã¦ãªãã£ã¦ãã§ã¨ã©ã¼ã«ãªãã ããªã®ã§æ°ãã¤ãã¦ãã
ãã¨ï¼diffãªãã·ã§ã³ä»ãã¦ï¼ã¤ã®ãã¡ã¤ã«ãæå®ããã¨ï¼diffãã¥ã¼ã§éããããããã
$ idea diff file1 file2
ä¸å¿ï¼ãããã®ä»¶ã¯ãã«ãã«æ¸ãã¦ãããããã
â http://www.jetbrains.com/idea/webhelp/working-with-intellij-idea-features-from-command-line.html
ãã¾ãï¼ãã®ï¼
ããã¸ã§ã¯ãå¤ã®ãã¡ã¤ã«éãããï¼ãããé ¼ãã«Navigation Barããï¼ä»ã®ãã¡ã¤ã«ã辿ããã¨ã...ã
ãã¾ãï¼ãã®ï¼
ãã¯ã¼ã¯ã¹ãã¼ã¹ããªãããããã¸ã§ã¯ã横æããæ¤ç´¢ã£ã¦ã§ããªãããããï¼ãã¨ãµã¨æãã¤ãããã©ï¼å®ã¯ã§ããï¼ç¥ããªãã£ãï½ï¼ã
Editor->Find->Find in Path...ã§æ¤ç´¢ãã¤ã¢ãã°åºãã¦ï¼ScopeããDirectoryãã«ããã ãã ã£ãããã®å ´åï¼IntelliJã®ã¤ã³ããã¯ã¹å¹ããªãããé
ããã©ã
*1:åèï¼Install IntelliJ IDEA - Help | IntelliJ IDEAã¨Install IntelliJ IDEA - Help | IntelliJ IDEA
*2:IntelliJ以å¤ã ã¨ãProject Structureãèªä½ãåå¨ããªãã¿ãããªã®ã§ï¼ãã¶ãFile->Settingsããè¨å®ããã ã¨æã