Skills

How do I find where JDK is installed on my windows machine?

If you are using Linux/Unix/Mac OS X:

Try this:

1
$ which java

If you are using Windows:

1
2
where java 
or C:> for %i in (javac.exe) do @echo. %~$PATH:i


how to compile servlets from commmand prompt

Type the following command for the working directory:

1
javac -classpath C:\apache-tomcat-7.0.23\lib\servlet-api.jar MyTestServlet.java

if your environmental variable CLASSPATH contains libraries you need you might want to do:

1
javac -classpath %CLASSPATH%;C:\apache-tomcat-7.0.23\lib\servlet-api.jar MyTestServlet.java