Configuring Eclipse to work with Tomcat

INSTALLİNG ECLİPSE AND TOMCAT

  1. Download Eclipse ide from Sun download site. Download the Java EE ide.[1]
  2. Extract the .zip file to which directory you want.i prefer using C:\Java\eclipse.Create desktop shotcut if you want for easy use.
  3. Download the Tomcat 6.x from the apache web site .Do not download windows installer package it comes without some command line utilities.Download the core package not other ones.[2]
  4. Extract the Tomcat same directory too like C:\java\tomcat
  5. You can now open eclipse for springide installation
  6. From Help->Software Updates give link to eclipse to download springide which is “http://springide.org/updatesite
  7. Then install the software it automatically downloaded and installed by eclipse just wait.
  8. After installation complete just restart the ide to changes take effect.

CONFİGURİNG TOMCAT FOR ECLİPSE

  1. From the menu bar select Window->Preferences
  2. The Preferences window will open. Expand Server
  3. Highlight Runtime Environment. This is the place where you can tell Eclipse about where you put your Tomcat installation
  4. Click Add
  5. Expand Apache and select Apache Tomcat v6.0.
  6. Check the Create a new local server check box to create a new server in the Servers view
  7. Click Next.
  8. Leave the Name of the server set to Apache Tomcat v6.0
  9. Eclipse gives the option to download a version of Tomcat but it usually does not have the latest version (which is why we downloaded it separately). Click Browse and navigate to c:\java\tomcat and click Ok
  10. Leave the JRE drop down set to Workbench default JRE.
  11. Click Finish.
  12. You are taken back to the Server Runtime Environments preference page so click Ok.
  13. A new project will have been created and if you go into the Servers view (in the bottom set of tabs),
    you will see a new server Apache Tomcat v6.0 at localhost.

CRAETİNG SPRİNG PROJECT

  1. Select File->New->Dynamic Web Project
  2. Enter a Project name.
  3. The Target Runtime should already be set to Apache Tomcat v6.0.
  4. Also keep the Configuration set to Default Configuration for Apache Tomcat v6.0.
  5. Click Finish.
  6. In the Project Explorer, right click on the new project and select Spring Tools->Add Spring Project Nature.

CONNECTİON BETWEEN SPRİNG AND TOMCAT

  1. Make sure the Servers view is visible (in the bottom set of tabs). Highlight your new Spring Web project and drag it on to the Tomcat v6.0 Server at localhost entry in the Servers tab.
  2. We want to use the Tomcat server when we use our new project, so we can set the Server project to be a dependency of our new project. This will mean that when we open our project the Server project will open automatically.
  3. Right click on our project and select Properties.
  4. Select the Project References option and check the Servers project.
  5. Click Ok.

コメント

人気の投稿