I am new to JSp and servlets. I am trying to compile the servlet,as my first example from the book "head first". In the book it shows that for compilation "-d" has to be used in the development environment to place the compiled file inside the class directory. When I try to compile it doesn;t do anything. Instead the compiler asks me use the "javac" properly with proper options.
Is there any easy way to compile this so that I can test my first servelt. by the way I am not using the JSP at this point. I have a JDK 5.0 (J2SE dev Kit 1.5).
I will really appreciate if anyone can help me out here. Or maybe a sight where I can find easy to follow guidelines and steps along with compiles codes. Thank you
You can compile it normally with out using that -d option and just place the class file in the classes folder manually. just take the package structure out and try to compile it using javac classname.java . that should work. otherwise let me know the command you are using.
I am using tomcat and i have to set the CLASPATH variable. Now if i simply use the javac classname.java it doesn't recognise the servelt classes, which are imported in the code. if my file "selectBeer.java" is in the directory "c:\app\test" then what will be the CLASSPATH value, using the servlet-api.jar in the tomcat.
Joined: Nov 21, 2005
Bear I am not sure if I hijacked anyone's question. I am simply trying to continue the conversation based on all the replies. So I am really not sure what I have done wrong here. But I really appreciate everyone's feedback. The servlet is finally running and I thank you all for that.