Hello sir i am new to
java and using Apache
Tomcat 7.0.22
and i am trying to compile two classes (one is
servlet and second is java class called by servlet). After completing my coding i tried to compile both classes first i comiled java classes which was successfully compiled and .class file created but when i tried to compile servlet file its gave me error at the line where i created and instantiate object for java class.
I also got this problem before that time but i solved it by seting the classpath in cmd by putting the command:-
set classpath = .; C:\Program Files (x86)\Apache Software Foundation\Apache Tomcat 7.0.22\webapps\loginnapp\WEB-INF\classes\;
in this folder i contained to java files (Function.java(servlet) and (Register.java(class)))
code for previous was working fine ...
but now second time i got this problem again and i again used this trick but fail to solve the problem. i set the classpath as i setted previously:-
set classpath = .; C:\Program Files (x86)\Apache Software Foundation\Apache Tomcat 7.0.22\webapps\LoginApp\WEB-INF\classes\;
in this folder i contained to java files (Controler.java(servlet) and (ConnectDB.java(class)))
but this time my classpath trick is not working some guys saying that we can set the classpath onetime only second class path not accepted and some says we have to set the both classpath old and new (in one time) because when we set one classpath and after that we set second it removes previous one. I can't understand what that mean
but i am searching for fix (all in one) solution that will work for all application... No seperate path for seprate application
why this problem creates an issue in window 7 please help me to find solution .... if anybody fix it permanently.....
here is code for my servlet:-