0

I want to develop dynamic web applications.

For this I am using Eclipse Helios and Tomcat 7.0.33. I have the JRE installed on my machine and I have provided the location of the JRE in the JAVA_HOME path.

But when I am running any servlet, I get the error:

" HTTP Status 404 " -- " The requested resource is not available "

Do I need a JDK in place of the JRE (meaning I have to set the path of the JDK in place of the JRE)? Or could there be another other reason why this error is happening?

Looking for Help!

Perception
  • 79,279
  • 19
  • 185
  • 195
Vikash Chahal
  • 71
  • 1
  • 3
  • 15
  • 1
    No, that error message is entirely unrelated. You used to need a JDK for Tomcat so it could compile your JSPs, but it now has the same compiler that Eclipse itself contains. Have you double-checked your servlet mappings and checked through http://wiki.eclipse.org/WTP_Tomcat_FAQ ? – nitind Nov 28 '12 at 09:13
  • If in doubt - just install the JDK. it has some useful tools for development – WeMakeSoftware Nov 28 '12 at 09:16
  • Check your Tomcat log for errors: /logs/catalina.out, /logs/catalina.err. Add any errors you find to this question. – Perception Nov 28 '12 at 09:21

3 Answers3

0

If your servlets are already compiled then JRE will serve the purpose,

But they are compiled then you will JDK and other libraries( like servlet-api.jar, etc.) to compile you servlets.

In short JDK is for development where you want to develop something using Java.

And JRE is used when you already have compiled classes and you just want to run it.

You might want to refer to this :

What is the difference between JDK and JRE?

Community
  • 1
  • 1
Abubakkar
  • 15,488
  • 8
  • 55
  • 83
  • But as I am using the Eclipse Helios so , in that case we would not require the JDK and I should be able to run the Servlet on the server through the Eclipse Helios(eclipse Java EE IDE for Web Developers). But I am not able to find any option to Build or Compile when I right click on the servlet or its parent package.. – Vikash Chahal Nov 28 '12 at 09:38
0

In theory, compiling with Eclipse's incremental compiler is sufficient. Running the application server with a JRE should be fine as well. I suppose your error is somewhere else. Anyway, I'd strongly recommend installing a JDK for developing a Java application. It comes with some handy tools and many 3rd party tools (Maven, e.g.) also require a real JDK compiler and can't work with Eclipse's built in compiler.

sorencito
  • 2,517
  • 20
  • 21
0

I had the same problem. The JDK was not the issue. After you compile your servlet you have to restart your tomcat server so it can load your class files before you try to access it through the web browser. No more 404 errors after that, servlets are running fine.