"Welcome To Ashok IT" "Spring Boot and MicroServices" Topic : Environmental Setup Date : 14/09/2024 (Session - 24) _____________________________________________________________________________________________________________________________ Yesterday session ================= * Spring Boot * Features * Advantages * Spring Vs Spring Boot Today Session ============= Spring Boot Environmental Setup =============================== Step-1 : ======== * First Make sure we should install Java Software in our machine with minimium version will be Java8 Version NOTE ==== ** Always recommended to install Long Term Support(LTS) Version i.e.,Java8,Java11,Java17,Java21 ** Make sure We need to configure the path variable correctly for Java Software. path :::: c:\programFiles\Java\jdk8.10.12\bin ** We need to create new Variable under Environmental variables section i.e.,JAVA_HOME JAVA_HOME >>>>>>> c:\programFiles\Java\jdk8.10.12 Step-2 : ======== * We need to install at least one IDE for Developing the Spring Boot Application 1) STS IDE ========== >>>>> Navigate to https://spring.io/tools >>>>> Select "Spring Tools 4 for Eclipse" >>>>> Click on Following Button "4.18.1 - WINDOWS X86_64" >>>>> Automatically will download as JAR File. >>>>> After downloading the JAR simple extract into normal folder(Winzip/7zip) and find the STS executable file. >>>>> After opening executable file configure your workspace folder in our Hard drive to place all the Spring Boot Projects. >>>>> Create New Spring Boot Project by Navigating (Goto File Menu >>> Project Option >>>> SpringBoot >>> Spring Starter Project) >>>>> We need to provide the below details while creating spring boot project Service URL ::::: https://start.spring.io Name ::::::: 08_SpringBoot_FirstApplication Type ::::::: Maven Packaging ::::::JAR Java Version:::::17 Group ::::::: com.ashokit ArtifactId 08_SpringBoot_FirstApplication Version :::::: 0.0.1-SNAPSHOT Description ::::: Demo project for Spring Boot Package ::::::: com.ashokit (basepackage for component scan) >>>>> Select Spring Boot Version "3.3.3" >>>>> No Need to select "Any Starter" from List. >>>>> Click on Finish Button. >>>>> Finally Spring Boot Project gets Created in the STS IDE 2) Intellij IDE =============== >>>>> Navigate to https://www.jetbrains.com/idea/download/#section=windows >>>>> Download the executable file under "Community Edition" i.e.,Free & Open Source IDE >>>>> Complete the installation process similar to normal software installation process. >>>>> We can create sample Spring Boot Application from Spring Intializer Website and download the Spring Boot application as zip file and extract it in our local machine. >>>>> Open the intellijIDE and import the Spring Boot Project. Step-3: ======= * Create some of Spring Beans in Spring Boot application and Run the Main Class by right click on it and choose option "Run as" >>>> Again choose "Spring Boot Application/Java Application". Understanding Spring Boot Application Structure =============================================== SpringBootFirstApplication (Application Name) | | |---------------> src/main/java >>>>>>>>>>>> To Place source code of our application. | | | |-----> com | | | |----> ashokit | | | |------> SpringBootFirstApplication.java (Main Class) | |---------------> src/main/resources >>>>>>>>> To place configuration files for our application | | | |-----> application.properties >>>>>> Default configuration file in Spring Boot Application. | |---------------> src/test/java >>>>>>>>>>>>> To place your source code related to test cases. | | | |-----> com | | | |----> ashokit | | | |------> ApplicationTests.java (Test Main Class) |---------------> Maven Dependencies | | | |-----> *.jar Files | |---------------> pom.xml >>>>>>>>>>>>> Project Related Configuration File | | | | -----> Dependencies Configuration pom.xml ======= Spring-boot-dependencies(Parent Project) ^ | Spring-boot-starter-parent(Parent Project) ^ | Our Spring Boot Project(Child Project) NOTE ==== 1. If programmer is not selected any starter during the spring boot project creation will get following starter by default i.e.,spring-boot-starter & spring-boot-starter-test will provides spring related functionalities. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++