Use the following steps as below:
Step 1. set home as the screenshot:
Step 1. set home as the screenshot:
Step2. write the above variable name and values in the System variable as below:
or see another for full screen:
Step3. Set Path as below:
Step4. set CATALINA_ HOME in System variable as below:
Finally, you have completed all necessarily setps.
Now, open command prompt and type as follow to compile the .java file:
Since DemoServ.java and HEERA.java files are under servlet folder on the desktop.
So that we have to use change directory command and type as below:
cd desktop
cd servlet
Then follow the further steps for compilation:
C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\servlet-api.jar
Further, use command to compile with java compiler javac (which is JIT)
javac DemoServ.java
javac HEERA.java
Another Ways:
Consider the following steps:
step1. copy servlet-api.jar from C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib
step2. paste into the following directory as below:
C:\Program Files\Java\jdk1.8.0_76\jre\lib\ext
Screenshot is as follow: