[Logo]
Forums Register Login
Head first Servlet & JSP : command syntax I cann't explain why
Hello All,
I run the programs in Chap3 of Head First Servlet and JSP.

For compiling the Servlet version 1, I used the command as the book stated "javac -classpath /tomcat55/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/BeerSelect.java".

It will show up the error messages as "package javax.servlet does not exist...." , but if I leave out the flag ":classes:." after the "...servlet-api.jar" it compile without error, and testing with servlet is OK.

What this flag ":classes:." means ? why it causes problem in my environment ? Any idea ! looking forward to hear from you !
Thanks!

Albert
Under Windows, you have to use semicolons instead :
";classes;."
Moving to Java In General (Beginner) where javac and classpath issues are discussed.

You can also find information on compiling servlets in our servlets FAQ:
http://faq.javaranch.com/view?CompilingServlets
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 21, 2017 12:53:44.