Installation and set up of Ubuntu, Eclipse, Tomcat, ANT, Spring Framework in virtual environment.

oralwideΔιακομιστές

17 Νοε 2013 (πριν από 3 χρόνια και 6 μήνες)

86 εμφανίσεις

Installation and set up

of Ubuntu,

Eclipse,

Tomcat,

ANT, Spring Framework

in virtual
environment.


1.
Virtual Environment:

To set up a virtual box, download oracle virtual box :

https://www.virtualbox.org/wiki/Downloads

Provide the memory and RAM

for the virtual box.


2.
To configure ubuntu in Virtual environment:

Download ubuntu Desktop :
http://www.ubuntu.com/download
.

Place the downloaded ISO in the virtual box settings.


3.

Installing and configuring Eclipse IDE for Web Development


Pre
-
requisites:

Java 6 should be installed prior to installation of Eclipse in Ubuntu.

Install java from ubuntu software center.


To download

eclipse

in ubuntu: sudo apt
-
get install eclipse

In Linux, we need to install WTP plugins for JEE

to create web applications.


I
nstall Web Tools Pla
tform(WTP) plugins in eclise:


1. Run the Eclipse IDE


2. Go to Help Menu
--
>Install new software


3. Give this url


on 'work with' http://download.eclipse.org/releases/galileo/ and click 'Add' to



download Java EE plugins

from the repository


4. Click next and select WTP packages to install


5. After you are done restart eclipse IDE


6. Change the eclipse perspective






click on Window
--
> Open Perspective
--
> JEE



4
.

Installing and configuring Apache Tomcat Server:
7.0.22


1. Download Apache tomcat 7.0.22 or higher version from
http://tomcat.apache.org/download
-



70.cgi?Preferred=http%3A%2F%2Fapache.mirrors.hoobly.com%2F


2. Extract it and place it under /usr
/local/tomcat7


3. For autostart create following script in /etc/init.d



[sudo vi /etc/init.d/tomcat7]


paste these following lines

***********************************************

# Tomcat auto
-
start

#

# description: Auto
-
starts tomcat 7

# processname:
tomcat7

# pidfile: /var/run/tomcat.pid


export JAVA_HOME=/usr/lib/jvm/java
-
6
-
sun


case $1 in

start)



sh /usr/local/tomcat7/bin/startup.sh



;;

stop)




sh /usr/local/tomcat7/bin/shutdown.sh



;;

restart)



sh /usr
/local/tomcat7/bin/shutdown.sh



sh /usr/local/tomcat7/bin/startup.sh



;;

esac


exit 0

************************************************


4. Save the file and set executable permissions

[sudo chmod 755 /etc/init.d/tomcat7]


5. Link the startu
p script to startup folders

[sudo ln
-
s /etc/init.d/tomcat7 /etc/rc1.d/K99tomcat]

[sudo ln
-
s /etc/init.d/tomcat7 /etc/rc2.d/S99tomcat]


6. Finally start the tomcat server

sudo /etc/init.d/tomcat7 start


7. Test the setup in browser

Open URL : http://local
host:8080/
--

you should be able to see the tomcat welcome page


5
. Configuration for Running Tomcat from eclipse:


To work it around, you need to add the tomcat
-
juli.jar to the run configuration class path.


Here are the steps how to do it:

1. In Eclipse,

Open the "Server" tab.

2. Double click on the "Tomcat7" entry to see the configuration.


3. Then click on the "Open launch configuration" link in the "General information" block.


4. In the dialog, select the "Classpath" tab.


5. Click the "Add external j
ar" button.


6. Select the file "/usr/local/tomcat7/bin/tomcat
-
juli.jar" (select from where your tomcat is

installed)


7. Close the dialog.


8. Start tomcat 7 from Eclipse.


6
. Installing Ant Build Tool:

1. download the latest version of Ant from:











http://ant.apache.org/bindownload.cgi


2. place it under:/usr/local/


3. set the environment variable for ant











sudo gedit /etc/bash.bashrc


Add the following lines to bash.bashrc file:











export ANT_HOME=/
usr/local/ant











set path=$path $ANT_HOME/bin



4. After setting up tomcat with eclipse and completed writing the web application:



open Terminal: ant
-
version (just checking if the installation is correct)




7
. Installing Spring Fram
ework:


1) Download spring framework 3.0.6 from:

http://www.springsource.org/download


2) extract the zip file and keep the extracted file in /usr/local/


3) Inside extracted spring folder, there are four files:





i. dist





ii. docs





iii
. projects





iv. src


4) To configure spring framework:


-

simply add all jar files in the 'dist' folder to the the library (in eclipse) using


build path



-

Also add common
-
logging.jar file to the library (where is this jar file?
--

spring framework
3.1.0.M2
--
>projects
--
>spring
-
build
--
>lib
--
>ivy)



-

Finally copy all the jar files in 'dist'+ common
-
logging.jar file and paste it in lib folder in
eclipse ( where? in eclipse
--
war
--
>WEB
-
INF
--
>lib)


(Remember: one more jar file for
Junit test which must be added to build path is: "junit
-
4.10.jar"
, you can add it later)


8
.Installing
Mysql
:

1.Install mysql client and mysql server from ubuntu software center.

2. After installing open terminal: m
ysql

u root

p
(to check whether mysql

is configured



properly).