Spring Framework Environment Setup – Install Spring Framework
In our last Spring Framework Tutorial, we studied Spring Framework Architecture. Today, we will discuss Spring Framework Environment Setup to begin your coding work with Spring Framework. This article will teach you to setup JDK, Tomcat and Eclipse on your PC.
So, let’s start Spring Framework Environment Setup.
2. Spring Framework Environment Setup
To install Spring Framework there are several steps have to be followed which are-
- Setup Java Development Kit (JDK)
- Installing Apache Common Logging API
- Setup Eclipse IDE
a. Setup of Java Development Kit (JDK)
You can download the latest version of the Java SDK from the official Oracle’s Java site download (http://www.oracle.com/technetwork/java/javase/downloads/index.html). You can find the instruction for installing JDK in your files. Follow these steps to install and config the setup of JDK. Then set the PATH as well as JAVA_HOME environment variables to that directory that contains java and javac.
For Windows as your OS and have installed JDK in your C:\jdk1.6.0_15 write the following in your C:\autoexec.bat
Also, for Window 2000/XP right click on My Computer select Properties->Advanced->Environment Variables update the PATH value and click OK.
For Unix OS if SDK is installed in /usr/local/jdk1.6.0_15 use C shell and write the following in your .cshrc file.
setenv PATH /usr/local/jdk1.6.0_15/bin:$PATH
setenv JAVA_HOME /usr/local/jdk1.6.0_15
For people using IDE like Eclipse, IntelliJ IDEA you have to compile and run a simple program so as to confirm that IDE knows where you have installed Java.
Let’s Read Some Major Features of Spring Framework
b. Installing Apache Common Logging API
You can download the latest version of Apache Common Logging API from https://commons.apache.org/logging/download_logging.cgi. Once you download it to unpack the binary file in your location. It should be like the below picture.
Make sure CLASSPATH variable is set up properly on your directory else it will cause a problem while running your application.
c. Setup of Eclipse IDE
This article Spring Framework Environmental setup will show the installation of Eclipse IDE while another IDE’s can also be downloaded. To install Eclipse IDE on your PC, download the latest binaries from https://www.eclipse.org/downloads/. Once it is downloaded unpack the binary into your location. For example, C:\eclipse for Windows or /usr/local/eclipse for UNIX/LINUX and then set PATH variable.
Do you know Spring IoC Containers and other Types of Spring Container
Finally, after this start Eclipse by executing following commands on Windows PC or just by double clicking on eclipse.exe
For UNIX/Linux machines follow the below line of commands on your machine:
It should look like below after a successful start-up of the Eclipse.
d. Setting up Spring Framework Libraries
Now with completing all the above steps the last final step is to setup your Spring Framework. For this make sure you make a choice whether the framework should be on which OS. Then proceed to the download the zip file for Windows and tz for Unix. Download the latest version of Spring framework binaries from https://repo.spring.io/release/org/springframework/spring. During the time of this Spring Framework Environment Setup tutorial, version 5.0.6.release was downloaded on Windows machine. After the file was unzipped it gives the following structure as given below.
You will find all the Spring Libraries inside the libs in the folder where you have unpacked your file. Make sure that the CLASSPATH variable has been set on this directory else it will cause a problem during a running of your application. If you are using Eclipse then there is no need of setting your CLASSPATH.
So, this was all about Install Spring Framework Tutorial. Hope you like our explanation.
Hence, in this article, you got to know the steps to proceed in order to work Spring Framework Environment Setup. Also, what are the prerequisites before downloading the Spring Framework Libraries and what are steps of the setup of environment variables. Still, you have a query, feel free to ask in the comment section.
Related Topic- Top Spring Framework Books