asked on
java code not compiling
Java code not compiling.
Error
javac -cp C:\apache-tomcat-8.5.83\lib\servlet-api.jar Search.java
Search.java:3: error: cannot find symbol
import javax.servlet.ServietException;
^
symbol: class ServietException
location: package javax.servlet
Search.java:7: error: cannot find symbol
throws ServletException, IOException {
^
symbol: class ServletException
location: class Search
2 errors
I opened the servlet-api.jar file.
ServletException class is present there.
But I still get can not find symbol. What is the issue ?
How to resolve it ?
ASKER
@CHEJ
What JAR do I require if I want to keep javax?
I am using java 11.0.17 2022-10-18 LTS
ASKER
@CHEJ
afaik, it's all going jakarta, so you don't want to. Did that work?
It did not work
ServietException
should read
ServletException
It's just a typo ;-)
This has nothing (yet) to do with the transition from javax to jakarta, especially not for Apache 8.5!
It's just a typo ;-)
Hehe. Well spotted!
Apache Tomcat based on Jakarta will come with version Tomcat 10.1.2!
ASKER
It's just a typo
Yes. Its working now. Thanks
How did you catch it ? are you using IDE ?
I am using a Notepad only. I could not catch it even after reading couple of times !! Do you have any suggestion how to avoid such silly mistakes ?