I am trying to compile the servlet file from command prompt,
i opened command prompt and changed the directory structure to my file location i:e C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\BeerV1\WEB-INF\src\com\example\web\BeerSelect.java
and then executed the command javac BeerSelect.java
but i am encountering the following error :javac is not recognized as internal or external command, operable program or batch file
Alternatively, you can use the complete path of javac.exe in the bin directory of your jdk installation. But setting the PATH environment variable is preferred so that you can use the javac command directly.
First check java is installed properly or not. Then set a path of your java in system variable. Than execute it it will run.
May be there is problem with your java installation or problem with setting the path of java.