I am trying to compile the Java code HelloServlet.java
HelloServlet.java on my windows 7 PC:
I am following the directions at
http://www.cis.upenn.edu/~cis330/jetty.html
I am getting error at compilation as below. Could you please assist me to compile?
C:\jetty\jetty-6.1.11\jett
y-6.1.11>w
here javac
C:\Program Files\Java\jdk1.8.0_25\bin
\javac.exe
C:\jetty\jetty-6.1.11\jett
y-6.1.11>e
cho %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_25
C:\jetty\jetty-6.1.11\jett
y-6.1.11>d
ir
Volume in drive C has no label.
Volume Serial Number is E609-E068
Directory of C:\jetty\jetty-6.1.11\jett
y-6.1.11
11/13/2014 09:51 AM <DIR> .
11/13/2014 09:51 AM <DIR> ..
11/12/2014 03:32 PM <DIR> bin
11/12/2014 03:32 PM <DIR> contexts
11/12/2014 03:32 PM <DIR> contrib
11/12/2014 03:32 PM <DIR> etc
11/12/2014 03:32 PM <DIR> examples
11/12/2014 03:32 PM <DIR> extras
11/13/2014 09:48 AM 983 HelloServlet.java
11/12/2014 03:32 PM <DIR> javadoc
11/12/2014 03:32 PM <DIR> lib
11/12/2014 03:32 PM <DIR> LICENSES
11/12/2014 04:48 PM <DIR> logs
11/12/2014 03:32 PM <DIR> modules
11/12/2014 03:32 PM <DIR> patches
11/12/2014 03:32 PM 12,512 pom.xml
11/12/2014 03:32 PM <DIR> project-website
11/12/2014 03:32 PM 4,253 README.txt
11/12/2014 03:32 PM <DIR> resources
11/12/2014 03:32 PM 16,501 start.jar
11/12/2014 03:32 PM 141,436 VERSION.txt
11/12/2014 05:07 PM <DIR> webapps
5 File(s) 175,685 bytes
17 Dir(s) 119,868,235,776 bytes free
C:\jetty\jetty-6.1.11\jett
y-6.1.11>
C:\jetty\jetty-6.1.11\jett
y-6.1.11\l
ib>dir
Volume in drive C has no label.
Volume Serial Number is E609-E068
Directory of C:\jetty\jetty-6.1.11\jett
y-6.1.11\l
ib
11/12/2014 03:32 PM <DIR> .
11/12/2014 03:32 PM <DIR> ..
11/12/2014 03:32 PM <DIR> annotations
11/12/2014 03:32 PM <DIR> cometd
11/12/2014 03:32 PM <DIR> ext
11/12/2014 03:32 PM 500,194 jetty-6.1.11.jar
11/12/2014 03:32 PM 160,510 jetty-util-6.1.11.jar
11/12/2014 03:32 PM <DIR> jsp-2.0
11/12/2014 03:32 PM <DIR> jsp-2.1
11/12/2014 03:32 PM <DIR> management
11/12/2014 03:32 PM <DIR> naming
11/12/2014 03:32 PM <DIR> plus
11/12/2014 03:32 PM 132,417 servlet-api-2.5-6.1.11.jar
11/12/2014 03:32 PM <DIR> win32
11/12/2014 03:32 PM <DIR> xbean
3 File(s) 793,121 bytes
12 Dir(s) 119,868,227,584 bytes free
C:\jetty\jetty-6.1.11\jett
y-6.1.11\l
ib>
C:\jetty\jetty-6.1.11\jett
y-6.1.11>j
avac -cp C:\jetty\jetty-6.1.11\jett
y-6.1.11\
lib\servlet-api-2.5-6.1.11
\servlet-a
pi-2.5-6.1
.11.jar HelloServlet.java
HelloServlet.java:2: error: package javax.servlet does not exist
import javax.servlet.*;
^
HelloServlet.java:3: error: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
HelloServlet.java:5: error: cannot find symbol
public class HelloServlet extends HttpServlet
^
symbol: class HttpServlet
HelloServlet.java:7: error: cannot find symbol
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
^
symbol: class HttpServletRequest
location: class HelloServlet
HelloServlet.java:7: error: cannot find symbol
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
^
symbol: class HttpServletResponse
location: class HelloServlet
HelloServlet.java:8: error: cannot find symbol
throws ServletException, IOException
^
symbol: class ServletException
location: class HelloServlet
HelloServlet.java:20: error: cannot find symbol
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
^
symbol: class HttpServletRequest
location: class HelloServlet
HelloServlet.java:20: error: cannot find symbol
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
^
symbol: class HttpServletResponse
location: class HelloServlet
HelloServlet.java:21: error: cannot find symbol
throws ServletException, IOException
^
symbol: class ServletException
location: class HelloServlet
9 errors
C:\jetty\jetty-6.1.11\jett
y-6.1.11>
Open in new window
please post output of above