Results 1 to 2 of 2
  1. #1
    mikewertheim is offline Member
    Join Date
    Feb 2009
    Posts
    1
    Rep Power
    0

    Default how to import existing Tomcat app into Eclipse

    I have an existing java app, running under JDK 1.6 and Tomcat 6.0.18 on Windows. The java app contains a directory hierarchy of java files, plus an ant build.xml file. I'm using Eclipse 3.4.

    What I want is: 1) for Eclipse to allow me to edit the java files in place, without copying the java files to some other directory, 2) for Eclipse to invoke my ant script to build the project, and 3) for Eclipse to be able to connect to Tomcat for debugging.

    So far, I have created a new Dynamic Web Project, selected "Apache Tomcat 6.0" as my target runtime, and pointed Eclipse to the directory that Tomcat is installed in.

    I am perplexed as to what the next step is.

    I want to tell the Eclipse project that the source code is already in a particular directory. None of the options under Import seem to allow me to give it a whole directory. And I imagine that Import might copy all the files, which isn't what I want.

    I'd appreciate any help.


    Thanks!
    Mike

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    I'm not familiar with the Web app support native to Eclipse, but I have used the support in the MyEclipse plugin. It includes a publish option, which will send the current contents of my app to the specified location. In addition, it has the ability to run Tomcat from within the IDE.

    I'm saying this because MyEclipse has its own project structure that must, like all projects, be inside a workspace. The project structure is similar to, but not identical to, the Tomcat structure. I doubt there is any way to do what you are describing.

    Having said that, editing your deployed app in Tomcat doesn't sound like a great approach, even for a development server. I suggest using the support provided by Eclipse and publishing to Tomcat periodically. If your tools support a built-in Tomcat environment, which I suspect they do, use that.

    To get what you have into Eclipse is relatively easy. Just create a new Web project. Use the OS file manager to copy the source files and resources from Tomcat to your project, putting them in the appropriate places.

    I realize this is not what you asked for, but I think you will be happy you went this way in about a week...

Similar Threads

  1. how to import war file with tomcat?
    By makpandian in forum NetBeans
    Replies: 0
    Last Post: 12-31-2008, 11:00 AM
  2. Eclipse import line wrap
    By bogomips in forum Eclipse
    Replies: 0
    Last Post: 11-26-2008, 04:16 PM
  3. How to import a package in Eclipse?
    By naipulb in forum New To Java
    Replies: 2
    Last Post: 06-09-2008, 11:04 AM
  4. How to import java project to Eclipse?
    By techissue2008 in forum Eclipse
    Replies: 1
    Last Post: 05-30-2008, 10:07 PM
  5. Tomcat In Eclipse - Sysdeo Tomcat Plug-in
    By JavaForums in forum Eclipse
    Replies: 1
    Last Post: 02-13-2008, 10:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •