I have a java project which can run on tomcat and the project now have some problem which need me to fix. They give me a ROOT file to replace the root on tomcat to let the project run.I have all the .class file and I can decompiler to see them.But, how can I put these code into eclipse and run them as a web service? Jdk version:1.6.0.22 and Tomcat version:6.0.0.29
Actually you can do that. Create an eclipse Dynamic web Project, copy all the sources and paste to src folder project.
Go to the WEB-INF/lib of your app and copy all the jar files and paste to WebContent/WEB-INF/lib folder.
Verify the WEB-INF folder of your app because maybe there are jsp or html files in there, in case of that please copy all them an paste to WebContent/WEB-INF
Now the challenge will be the jdk version and tomcat version that are old, try to use the same versions on your development environment otherwise it will be kind of dificult to put the change to production environment.
Then try to run, it will throw a lot of errors, verify them and keep looking other dependencies maybe the configurations on web.xml, or server.xml. Sorry but its a very detail process, its not automatic.
Note: if you need only to change a .class file, then change it and compile it and just replace the .class file on production environment, avoid to replace the entire project, and remember, if you make any change on production please restart tomcat and verify log files, and again verify log files it will save a lot of time and effort.
Hope it helps.