Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat and java SDK problem

I am trying to create a new dynamic web project in eclipse (in ubuntu). When I point to Target Runtime as Tomcat V 7.0 , I get the below warning

runtime "Apache Tomcat v7.0" is invalid. Tomcat requires a Java SDK in order to
compile JSP files. Ensure that the JRE preference settings point to an SDK.

But the installed JREs already show java-6-openjdk . Am I missing something?

Also when I ignored that and started Tomcat anyway , it started successfully in port 8080 . But when I said http://localhost:8080 , it threw 404 resource not found error .

Do you see any problems here?

like image 766
Vinoth Kumar C M Avatar asked Apr 17 '11 08:04

Vinoth Kumar C M


People also ask

Does Tomcat need JRE or JDK?

Tomcat's RUNNING. txt which you can find in the root of the bundle states that Apache Tomcat requires Java Standard Edition Runtime Environment (JRE) to run.

How should I configure Tomcat so that it uses the JRE path not JDK path?

We can change the JRE for Tomcat by setting the JRE_HOME variable in a script file called setenv. bat (on Windows) or setenv.sh (on *nix). This file does not exist by default, so create such file and place it under CATALINA_BASE\bin directory (CATALINA_BASE is the Tomcat installation directory).

Does Tomcat use JAVA_HOME?

To understand how Tomcat pick up which JDK to run, refer to the Tomcat startup script – /etc/init. d/tomcat7 . Normally, Tomcat will use the JDK which configured in the JAVA_HOME environment, if JAVA_HOME is not set, Tomcat will find a random JDK from a pre-defined location.


1 Answers

You maybe didn't install the JDK or didn't appoint the Tomcat server to it ..

so try to make sure that you installed the JDK not just JRE..

but If you are already installed the JDK you have to make sure to make preference settings point to the SDK ..

so in eclipse go to Window >> Preferences >> Server >> Tomcat >> Tomcat 7.X >> Edit >> and point it to JDK not JRE ..

if you don't find "Tomcat" is Servers you may find "Installed Runtimes" >> Edit >> and point it to JDK not JRE ..

like image 143
Majed Avatar answered Sep 18 '22 15:09

Majed