Error Package Javax.servlet Does Not Exist Import Javax.servlet
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Package javax.servlet.*; does not exist, other javax package also not exist up vote 0 down vote favorite I use JDK7,JRE7 and Tomcat 7. I already mentioned the classpath of Tomcat library in command prompt. But when compiling the servlet I got an error: package javax.servlet does not exist Please help. Thanks in advance. tomcat servlets package share|improve this question edited Nov 9 '13 at 19:51 informatik01 9,27763759 asked Nov 9 '13 at 18:57 RAJIB 44 3 The servlet-api.jar is located in dir $CATALINA_HOME/lib e.g. d:\tomcat7\lib so it should compile. Paste your compile error, it may indicate where the problem is. –lukpaw Nov 9 '13 at 19:07 here is the command prompt that i used, C:\MyProjects\project1>javac -classpath "C:\ProgramFiles\ApacheSoftwareFoundation\Tomcat7.0\lib\servlet-api.jar;classes;". -d classes src\Ch1Servlet.java and the compiler error shown after the compiling my servlet(i.e. Ch1Servlet.java), src\Ch1Servlet.java:1: error: package javax.servlet does not exist import javax.servlet.*; ^ src\Ch1Servlet.java:2: error: package javax.servlet.http does not exist. –RAJIB Nov 10 '13 at 5:56 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted I tested your example and the compiler error was shown when you have mispelling in the path. Command: javac -classpath
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges http://stackoverflow.com/questions/19881782/package-javax-servlet-does-not-exist-other-javax-package-also-not-exist Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR : javax.servlet does not exist up vote 2 down vote favorite 1 I http://stackoverflow.com/questions/22836220/error-javax-servlet-does-not-exist have checked almost all the posts possible for the error that I'm getting. Ive edited almost all the ENVIRONMENT VARIABLES as given online. These are my environment variables : ANT_HOME = C:\Ant9;C:\Tomcat7\lib\servlet-api.jar CLASSPATH = C:\Program Files\Java\jdk1.6.0_24\bin;C:\Program Files\Java\jre6\bin;C:\Tomcat7\lib\servlet-api.jar;. JAVA_HOME = C:\Program Files\Java\jdk1.6.0_24 PATH = C:\Program Files\Java\jdk1.6.0_24\bin TOMCAT_HOME = C:\Tomcat7 C:\Tomcat7\webapps\DBConnection\WEB_INF\classes\DBConnection>javac -cp .,C:\Tomc at7\lib\servlet-api.jar DBConnnection.java DBConnnection.java:4: package javax.servlet does not exist import javax.servlet.*; ^ DBConnnection.java:5: package javax.servlet.http does not exist import javax.servlet.http.*; ^ DBConnnection.java:11: cannot find symbol symbol: class HttpServlet public class DBConnnection extends HttpServlet ^ DBConnnection.java:14: cannot find symbol symbol : class HttpServletRequest location: class DBConnection.DBConnnection public void doGet(HttpServletRequest request, HttpServletResponse response) th rows ServletException, IOException ^ DBConnnection.java:14: cannot find symbol symbol : class HttpServletResponse location: class DBConnection.DBConnnection public void doGet(HttpServletRequest request, HttpServletResponse response) th rows ServletException, IOException ^ DBConnnection.java:14: cannot find symbol symbol : class ServletException location: class
This Site Careers Other all forums Forum: IDEs, Version Control and other tools Netbeans doesn't find javax.servlet.* https://coderanch.com/t/561238/vc/Netbeans-doesn-find-javax-servlet Olivier Legat Ranch Hand Posts: 176 I like... posted 4 https://coderanch.com/t/412015/java/java/solve-package-javax-servlet-exist years ago Howdy folks, So according to Andrew Monkhouse the javax.servlet.* package is not a package, it's from J2EE. So I went ahead and downloaded the Netbeans Java EE to get this thing to work but I get a error package nasty "package javax.servlet.http does not exist" error. And here I was thinking a bigger download would solve all my problems I'm a complete idiot with Netbeans, how to I check if I have Java EE and how do I reconfigure the project so it can find it? Thanks-you P.S. error package javax.servlet I'm on a Mac so I can't find the J2EE SDK anywhere in the Download Page Olly Olivier Legat Ranch Hand Posts: 176 I like... posted 4 years ago Resolved, I found the JAR files ... for Googler's that stumble upon this page here's how I did it: - Right-click the Libraries folder in the left-hand Projects tab - Goto /Applications/NetBeans/glassfish-3.1.1/glassfish/modules/ - Select all javax*.jar files. - Click Choose - Post a thank-you on this thread (optional) Olly Post Reply Bookmark Topic Watch Topic New Topic Similar Threads JSP editor in Eclipse Cannot see J2EE perspective in eclipse Installing Java EE web option is not coming while creating project Downloading help with JDK 6 All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter Contact Us | advertise | mobile view | Powered by JForum | Copyright © 1998-2016 Paul Wheaton
Site Careers Other all forums Forum: Beginning Java help me solve 'package javax.servlet does not exist' error srinivas pola Greenhorn Posts: 24 posted 8 years ago Hi, I am using tomcat6 and jdk1.5 I am not using any IDE and trying to compile the servlets through command prompt itself. The environment variables i have set are as follows: CLASS_PATH - C:\jdk1.5\lib;C:\tomcat6\lib\servlet-api.jar;C:\tomcat6\lib\jsp-api.jar;C:\tomcat6\webapps JAVA_HOME - C:\jdk1.5 Path - C:\jdk1.5\bin;C:\jdk1.5;C:\jdk1.5\jre\bin\server When i'm trying to compile the servlet i'm getting this error C:\tomcat6\webapps\HeadFirst\WEB-INF\classes\web>javac BeerSelectAction.java BeerSelectAction.java:3: package javax.servlet does not exist import javax.servlet.*; ^ BeerSelectAction.java:4: package javax.servlet.http does not exist import javax.servlet.http.*; ^ BeerSelectAction.java:7: cannot find symbol symbol: class HttpServlet public class BeerSelectAction extends HttpServlet { ^ BeerSelectAction.java:9: cannot find symbol symbol : class HttpServletRequest location: class com.example.web.BeerSelectAction public void doPost(HttpServletRequest request, ^ BeerSelectAction.java:10: cannot find symbol symbol : class HttpServletResponse Please help me solve this error. Thanks in advance. Jesper de Jong Java Cowboy Saloon Keeper Posts: 15543 43 I like... posted 8 years ago The error is here: CLASS_PATH - C:\jdk1.5\lib;C:\tomcat6\lib\servlet-api.jar;C:\tomcat6\lib\jsp-api.jar;C:\tomcat6\webapps The environment variable should be named CLASSPATH, not CLASS_PATH with an underscore in it. Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation srinivas pola Greenhorn Posts: 24 posted 8 years ago I could solve the problem Thanks Jesper srinivas pola Greenhorn Posts: 24 posted 8 years ago now i'm facing another problem... :roll: When