ååãGradleã¨ãããã«ããã¼ã«ã§ããã¸ã§ã¯ããä½ã£ã¦ããHello, world.ãã¾ã§ããã¾ããã
ä»åã¯ããã®ããã¸ã§ã¯ãã IntelliJ ã«èªã¿è¾¼ã¾ãã¦ãããã°ããã¨ããã¾ã§ããããã¨æãã¾ãã
ããã§ã¯ãã£ã¦ããã¾ãï¼
åèæç®
ã¯ããã«
ãJavaã§ãã¶ã¤ã³ãã¿ã¼ã³ãå¦ã¶ãã®è¨äºä¸è¦§ã§ããè¯ãã£ããåèã«ãã¦ãã ããã
Javaã§ãã¶ã¤ã³ãã¿ã¼ã³ã®è¨äºä¸è¦§
ã¨ã³ã¸ãã¢ã°ã«ã¼ãã®ã©ã³ãã³ã°ã«åå ä¸ã§ãã
æ°æ¥½ã«ãããã¨ãããããé¡ããããã¾ãð
ããã§ã¯ãã£ã¦ããã¾ãï¼
Ubuntu 22.04 ã« IntelliJ ãã¤ã³ã¹ãã¼ã«
IntelliJã®å
¬å¼ãµã¤ãã§ãã
www.jetbrains.com
ãã¦ã³ãã¼ããã¼ã¸ã«è¡ãã¾ããIntelliJ IDEA Ultimate ã¯ææãªã®ã§ããã®ä¸ã«ãã IntelliJ IDEA Communityçããã¦ã³ãã¼ããã¾ãã
ä¸å¿ãããã·ã¥ã®ä¸è´ã確èªãã¦ããã¾ãã
$ sha256sum ideaIC-2024.1.1.tar.gz
4d4221630c4d1dcb9f198370f82d9364014a4a624684ad8b3958be9f01eb656a ideaIC-2024.1.1.tar.gz
解åãã¾ãã
tar zxvf ideaIC-2024.1.1.tar.gz
æ©éèµ·åãã¦ã¿ã¾ãã
$ ~/Downloads/idea-IC-241.15989.150/bin/idea.sh
IntelliJã®ä½¿ç¨è¨±è«¾ã®ç»é¢ã表示ãããã®ã§ãåæã«ãã§ãã¯ãå
¥ãã¦ç¶è¡ãã¯ãªãã¯ãã¾ãã
ãã¼ã¿ã®å
±æã®ç»é¢ã表示ãããã®ã§ãã©ã¡ãããã¯ãªãã¯ãã¾ãã
IntelliJã®èµ·åç»é¢ã表示ãããã°æåã§ãã
æ¯åãèµ·åããã¨ãã«ãã«ãã¹ãå
¥åããã®ã¯é¢åãªã®ã§ãã¨ã¤ãªã¢ã¹ãè¨å®ãã¦ããã¾ãã
$ nano ~/.bashrc
alias idea='~/Downloads/idea-IC-241.15989.150/bin/idea.sh'
IntelliJã®ãµã³ãã«ããã¸ã§ã¯ãããã£ã¦ã¿ã
å
¬å¼ãµã¤ãã® Getting started ãåèã«ãã¦ãã£ã¦ããã¾ãã
www.jetbrains.com
IntelliJ ã®èµ·åç»é¢ã§ New Project ãã¯ãªãã¯ãã¾ãã
å¿
è¦ãªé
ç®ã«ã¤ãã¦å
¥åãã¦ãCreate ãã¯ãªãã¯ãã¾ãã
- New Projectï¼Javaãé¸æãã¾ã
- Nameï¼ä»»æã®ããã¸ã§ã¯ãåãå
¥åãã¾ã
- Build systemï¼Gradleã§ãã£ã¦ããã¾ã
- Gradle DSLï¼Kotlinãé¸æãã¾ã
ã¾ããæ¥æ¬èªåãã¦ããã¾ãã
å³ã®éç¥ã¢ã¤ã³ã³ãã¯ãªãã¯ããã¨ãæ¥æ¬èªè¨èªããã¯ãææ¡ããã¦ãã¾ãããInstall and restartããã¯ãªãã¯ãã¾ãã
èªåçã« IntelliJ ãåèµ·åãã¦ãæ¥æ¬èªåããã¾ããã
æ©éå®è¡ãããã¨ããã®ã§ãããè¦åãåºã¦ãã¾ããprintln()
ã®ã¨ããããprintf()
ã«ãªã£ã¦ããã¨ããè¦åã®ããã§ããèªåã§ééãã¦ãf
ãå
¥åãã¦ãã¾ã£ãã®ãã¨æãã¾ããï¼ç¬ï¼ããIntelliJ ã®ä¿®æ£ã®ææ¡ã®ãã¢ã³ã¹ãã¬ã¼ã·ã§ã³ã¨ãããã¨ã®ããã§ããã§ã¯ãAlt+Enter
ãæ¼ãã¦ã¿ã¾ããprintln()
ã¸ã®ä¿®æ£ãã¨æã£ãã print()
ãææ¡ããã¾ãããã¾ãããã®ã¾ã¾ print()
ã®ææ¡ãåãå
¥ãã¾ãã
ã§ã¯ãã¾ãã¯ãããã°ã§ã¯ãªããå®è¡ãã¦ã¿ã¾ãï¼â·ãã¼ã¯ãæ¼ãã¾ãï¼ã
ç¡äºã«å®è¡ã§ãã¾ãããæ¹è¡ã¯ããããªãã¨ã«ãªã£ã¦ã¾ãããå®è£
éãã®çµæã§ãã
ç¶ãã¦ããããã°ãã¦ã¿ã¾ãï¼è«ã®ãã¼ã¯ãæ¼ãã¾ãï¼ã
æåããè¨å®ããã¦ãããã¬ã¼ã¯ãã¤ã³ãã«æ¢ã¾ãã¾ããããããã°ã§ãã¦ããããã§ãã
Gradleããã¸ã§ã¯ããèªã¿è¾¼ã
ååä½æããGradleã§ä½æããããã¸ã§ã¯ããèªã¿è¾¼ãã§åããã¦ã¿ã¾ãã
ããã¸ã§ã¯ããéãã¦ããå ´åã¯ãããã¸ã§ã¯ããéãã¦ããã¾ãã
Gradleããã¸ã§ã¯ããèªã¿è¾¼ãã¨ãã¯ããéãããã¯ãªãã¯ãã¾ãã
Gradleããã¸ã§ã¯ãã®ãsettings.gradle.ktsããé¸æãã¦ãOKãã¯ãªãã¯ãã¾ãã
ããã¸ã§ã¯ããã¡ã¤ã«ã¨ãã¦éããã©ãããèãããã®ã§ãããã¸ã§ã¯ãã¨ãã¦éãããã¯ãªãã¯ãã¾ãã
ä¿¡é ¼ãã¦éãã¾ããï¼ã¨èãããã®ã§ããããã¸ã§ã¯ããä¿¡é ¼ããã¯ãªãã¯ãã¾ãã
ãã«ãããã¦ã³ãã¼ããªã©ã§ããã°ããæéããããã¾ãï¼5å以ä¸ãããã¾ããï¼ãå³ä¸ã®ã¡ãã»ã¼ã¸ã表示ãããªããªãã¾ã§å¾
ã¡ã¾ãã
èªã¿è¾¼ã¿ãå®äºããããå®è¡ãã¦ã¿ã¾ãã
ååã¨åãããã«å®è¡ã§ãã¾ããã
ãããã°ããã£ã¦ã¿ã¾ãã
æ®éã«ãããã°ã§ãã¾ããã
ãããã«
ä»åã¯ä»¥ä¸ã§ãï¼
IntelliJ 㨠Gradle ã®çµã¿åããã¯ã¨ã¦ã便å©ã§ãï¼ããããã©ãã©ã使ã£ã¦ãããã¨æãã¾ãï¼
æå¾ã¾ã§ãèªã¿ããã ãããããã¨ããããã¾ããã