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?
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.
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).
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.
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 ..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With