• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Imported WAR into Eclipse, trying to figure out .class editing

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've taken over development of a JSP application here recently and I can't seem to figure out how to edit the projects .class files.

I'm working in Eclipse, Kepler version, and I've imported the WAR file. I'm able to run the application through Eclipse using the default Tomcat 7.0 web server, and I can export the WAR file and load it just fine into other instances of Tomcat. The previous developer placed all of the .class files they created into a simple class folder that shows up under Java Resources > Web App Libraries > ImportedClasses . I've got all the original .java source files the .class files were generated from, I just can figure out what I need to do to import and compile them in the application, replacing the old ones in the process. Any ideas?

I'm still fairly new to JSP and the Java EE perspective in Eclipse, so if I'm not being clear or using the correct terminology please let me know.

Thank you.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before you can really employ an IDE such as Eclipse effectively, you need to understand how the project is constructed without an IDE. And, as you can see, when people make their project build processes dependent on stuff that they've done to their IDE and/or local filesystem, you can end up wasting a lot of time. Which is why I have a firm policy myself that every project must be buildable without an IDE or GUI using an offline tool such as Ant or Maven.

You don't "import a WAR" into Eclipse. A WAR is the output - the end product - of a build process. You start with a project, you build the project, and produce the WAR, which is then deployed locally or on some other machine's web application server.

Eclipse has a project property that determines where compiled classes are placed. If you had been given the full source for an Eclipse project, it would have included a ".project" file that included the path of that location. You can set it by bringing up the Eclipse project Properties dialog, going to the "Build" tab and defining the source and destination folders for building on that tab.

Take a look there. Chances are you'll have further questions. We'll be here, although you might also want to find a good book on Eclipse and/or on building J2EE web projects.
 
Ben Charles
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Tim,

Thanks for the reply. To setup the project in Eclipse I went to File > Import > Web > WAR file, I selected the WAR file to use ( runtime, name of Web Project, etc. ), and Eclipse set the project right up, albeit sans .java files which were obviously excluded from when the WAR was generated originally.

Do you have a book recommendation on developing J2EE applications in Eclipse? I've been reading JSP & Servlets by Budi Kurniawan and have really been enjoying it.

Thanks
 
Well behaved women rarely make history - Eleanor Roosevelt. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic