开发者

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 th开发者_运维技巧e 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?


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 ..


You need to set the java_home in ur machine , something like java_home=c:\java , this can be done in the system properties or you can set that from ur Tomcat properties.

If this is not working out like you are not able to find those files. better uninstall the tomcat and instal it back again , this time when it asks for the java home point to folder in which you have installed the jdk / jre

Tip : Sometimes if the directory name in which you have installed the jdk / jre has spaces then while pointing from tomcat will have some problem , better to hav a directory structure with whole words


As "Majed" says I'd changed path for Tomcat server. And additionly you must to delete server in Servers on ProjectExplorer. After that Eclipse themselves asked about which one server to select...


Tomcat needs a JDK in order to compile the generated servlet classes from your JSP. Thats why you get your error only after the applications has started.

Check if your JDK installation has a javac compiler inside the /bin directory. Also be sure that your Eclipse Tomcat server Java enrironment points to your JDK, not the JRE.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜