Programming‎ > ‎Java‎ > ‎15. Spring‎ > ‎

1. Setting Up Development Environment


Dev Environment

  • Install JDK (not JRE)
  • Spring 5 requires Java 8 or higher

Software
  • Java Application Server - for Web development, many options use Tomcat server
  • Java Integrated Development Environment, use Eclipse

Install Tomcat
  • Download Tomcat - 32-bit/64-bit Windows Service Installer (pgpsha512)
  • Install Tomcat -> Full -> Service Startup
  • Keep default configuration, Set Administration Login while Install
  • This will install Tomcat as Windows Service
  • Verify Tomcat at http://localhost:8080/ 
  • You can configure Tomcat, right-click+Configure at Tomcat icon in running program
  • Stop Tocat from Windows-> Services
  • Later run tomcat from Eclipse

Install Eclipse
  • Download Eclipse - Eclipse IDE for Enterprise Java Developers
  • Unzip eclipse
  • Open eclipse by double-click, choose workspace location

Connecting Eclipse and Tomcat
  • Start Tomcat from Eclipse
  • Easily deploy applications directly to Tomcat
  • Goto Eclipse bottom frame -> Servers -> Apache -> Tomcat v9.0
  • Choose next
  • This will associate Tomcat with Eclipse environment

What is Maven
  • Maven is a powerful project management tool that is based on POM (project object model). 
  • It is used for projects build, dependency and documentation. 
  • It simplifies the build process like ANT. But it is too much advanced than ANT. 
  • Maven helps to manage- Builds,Documentation,Reporing,SCMs,Releases,Distribution.

Download Spring 5 Jar Files
  • Create Eclipse Project
  • Download Spring Jar files
  • Add Jar files to Eclipse Project ... Build Path
  • Instead of manually downloading, you can use a tool like Maven

  • Change Perspective in Eclipse - Window -> Perspective -> Open Perspective -> Java
  • Create Project - File -> New -> Java Project
  • Project name - spring-one, Finish
  • Start downloading Spring 5 Jar - http://repo.spring.io/release/org/springframework/spring/
  • Choose latest Spring Jar i.e. spring-framework-5.1.5.RELEASE-dist.zip
  • Unzip the Spring Jar, Goto lib folder, copy all Spring Jar files
  • Goto Eclipse Project and create folder "lib" and paste all Spring Jar files
  • Add Jar files to this Project classpath - Project (spring-one) -> Right-click -> Properties -> Java Build Path -> Libraries -> Classpath -> Add Jars
  • Add all Spring Jars from (spring-one) -> lib (Select all Jars) and Apply and Close
  • Now you can see new item Reference libraries under spring-one. Eclipse say now gonna use these Jars for runtime and compile


Comments