views:

497

answers:

1

I'm new to Java. I have to modify this Web Servlet that is running on my Tomcat. The Webapps folder contains several files and directories, but only one .JAR file. I managed to decompile it using Java Decompiler JD-GUI, but when I create the project in Eclipse from the decompiled source and try to Validate it, Eclipse shows me around 389 errors. Errors like

HttpServlet cannot be resolved to a type

And I don't even know which Eclipse button rebuilds the .JAR file. Can anyone help me?

+1  A: 

Your eclipse project will need to include the libraries that the servlet relies on to work.

If you create the Eclipse project as a Dynamic Web Project it will set up some of the basic structure needed, including the relevant libraries. You may need to include other libraries if the original code relies on them, but from your description it seems fairly unlikely.

You can create a JAR file from the Eclipse File Menu. click Export..., and select Java->Jar file.

Many projects will use ANT which allows you to define scripts to perform tasks needed to compile, package, deploy and test a project.

AndyT