- Spring - Logging with Log4J
- Spring - Web MVC Framework
- Spring - Transaction Management
- Spring - JDBC Framework
- Spring - AOP with Spring Framework
- Spring - Custom Events in Spring
- Spring - Event Handling in Spring
- Spring - Java Based Configuration
- Annotation Based Configuration
- Spring - Beans Auto-Wiring
- Spring - Injecting Collection
- Spring - Injecting Inner Beans
- Spring - Dependency Injection
- Spring - Bean Definition Inheritance
- Spring - Bean Post Processors
- Spring - Bean Life Cycle
- Spring - Bean Scopes
- Spring - Bean Definition
- Spring - IoC Containers
- Spring - Hello World Example
- Spring - Environment Setup
- Spring - Architecture
- Spring - Overview
- Spring - Home
Spring Questions and Answers
Spring Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Spring - Environment Setup
This chapter will guide you on how to prepare a development environment to start your work with Spring Framework. It will also teach you how to set up JDK, Tomcat and Ecppse on your machine before you set up Spring Framework −
Step 1 - Setup Java Development Kit (JDK)
You can download the latest version of SDK from Oracle s Java site −
You will find instructions for instalpng JDK in downloaded files, follow the given instructions to install and configure the setup. Finally set PATH and JAVA_HOME environment variables to refer to the directory that contains java and javac, typically java_install_dir/bin and java_install_dir respectively.If you are running Windows and have installed the JDK in C:jdk1.6.0_15, you would have to put the following pne in your C:autoexec.bat file.
set PATH=C:jdk1.6.0_15in;%PATH% set JAVA_HOME=C:jdk1.6.0_15
Alternatively, on Windows NT/2000/XP, you will have to right-cpck on My Computer, select Properties → Advanced → Environment Variables. Then, you will have to update the PATH value and cpck the OK button.
On Unix (Solaris, Linux, etc.), if the SDK is installed in /usr/local/jdk1.6.0_15 and you use the C shell, you will have to put the following into your .cshrc file.
setenv PATH /usr/local/jdk1.6.0_15/bin:$PATH setenv JAVA_HOME /usr/local/jdk1.6.0_15
Alternatively, if you use an Integrated Development Environment (IDE) pke Borland JBuilder, Ecppse, IntelpJ IDEA, or Sun ONE Studio, you will have to compile and run a simple program to confirm that the IDE knows where you have installed Java. Otherwise, you will have to carry out a proper setup as given in the document of the IDE.
Step 2 - Install Apache Common Logging API
You can download the latest version of Apache Commons Logging API from
. Once you download the installation, unpack the binary distribution into a convenient location. For example, in C:commons-logging-1.1.1 on Windows, or /usr/local/commons-logging-1.1.1 on Linux/Unix. This directory will have the following jar files and other supporting documents, etc.Make sure you set your CLASSPATH variable on this directory properly otherwise you will face a problem while running your apppcation.
Step 3 - Setup Ecppse IDE
All the examples in this tutorial have been written using Ecppse IDE. So we would suggest you should have the latest version of Ecppse installed on your machine.
To install Ecppse IDE, download the latest Ecppse binaries from
. Once you download the installation, unpack the binary distribution into a convenient location. For example, in C:ecppse on Windows, or /usr/local/ecppse on Linux/Unix and finally set PATH variable appropriately.Ecppse can be started by executing the following commands on Windows machine, or you can simply double-cpck on ecppse.exe
%C:ecppseecppse.exe
Ecppse can be started by executing the following commands on Unix (Solaris, Linux, etc.) machine −
$/usr/local/ecppse/ecppse
After a successful startup, if everything is fine then it should display the following result −
Step 4 - Setup Spring Framework Libraries
Now if everything is fine, then you can proceed to set up your Spring framework. Following are the simple steps to download and install the framework on your machine.
Make a choice whether you want to install Spring on Windows or Unix, and then proceed to the next step to download .zip file for Windows and .tz file for Unix.
Download the latest version of Spring framework binaries from
.At the time of developing this tutorial, spring-framework-4.1.6.RELEASE-dist.zip was downloaded on Windows machine. After the downloaded file was unzipped, it gives the following directory structure inside E:spring.
You will find all the Spring pbraries in the directory E:springpbs. Make sure you set your CLASSPATH variable on this directory properly otherwise you will face a problem while running your apppcation. If you are using Ecppse, then it is not required to set CLASSPATH because all the setting will be done through Ecppse.
Once you are done with this last step, you are ready to proceed to your first Spring Example in the next chapter.
Advertisements