Add the servlet API JAR to the classpath (with -cp or CLASSPATH env variable).  
Or use Maven to build your projects and define the dependencies appropriately.

PK

-----Original message-----
From:   Timothy Murphy <gayle...@eircom.net>
Sent:   Tue 11-03-2014 05:01
Subject:        Java under Fedora
To:     users@lists.fedoraproject.org; 
> 
> I have a problem compiling a Java servlet program under Fedora-20.
> I'm not sure if the problem arises from my ignorance -
> I haven't used Java for several years, and never with servlets -
> or if the issue is the Java setup under Fedora,
> or thirdly, if there has been a change in the organisation of Java,
> and in particular in the configuration of the CLASSPATH.
> 
> In any case, I have been trying to compile the servlet HelloWorld.java
> from <http://www.tutorialspoint.com/servlets/servlets-first-example.htm>
> 
> When I run "javac HelloWorld.java" I get a number of errors like
>   HelloWorld.java:12: error: cannot find symbol
>     public class HelloWorld extends HttpServlet {
> 
> I see that this class is in /usr/share/java/tomcat-servlet-api.jar
> and if I expand this jar file in the current directory
> then the compilation succeeds.
> But it is not sufficient to copy the jar file to the current directory
> (or to put a link to it in /usr/lib/java/ .)
> 
> My question is: what should I do to ensure that javac sees this jar file
> without expanding it in this way?
> 
> 
> -- 
> Timothy Murphy  
> e-mail: gayleard /at/ eircom.net
> School of Mathematics, Trinity College, Dublin 2, Ireland
> 
> 
> -- 
> users mailing list
> users@lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
>
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org

Reply via email to