problem with compiling when i import javax.servlet.*;
I was reading some servlet tutorial and decided to try out the codes..
however when i try to compile, i get error msgs like
package javax.servlet cannot be found
what is wrong??
i am using j2ee 1.4
how come i cant compile the servlet?
i just installed...
but i still cant javac..
what am i supposed to do to be able to do tat?
This problem is related with CLASSPATH. After installing the jdk under your local directory, set the classpath information. I can provide you with the detail by which you can create a CLASSPATH variable and add the classpath information
Goto Mycomputer -> Right Click -> Select Properties -> CLick on the Advanced tab -> Click on the Environment Variables button -> Check for ClassPath variable, if you find one, click on the Edit button provided and provide the ClassPath information in the popup box. If There is no variable named Classpath then click on the New button provided below and provide the classpath .
If jdk is in C:
Then the path should be set as given below:
The version in the file name depends on the version of the jdk installed in your PC.
In my previous reply I mentioned Jdk in the classpath.
if you have the j2ee1.4 under C: ,Change it to j2ee1.4 and try
c:\j2ee1.4\lib and try..
im using d:/sun/appserver/lib
i put this into CLASSPATH but i still cant javac anything that requires import of javax.*.*
did i not already answer this?
Im sure i told you to post the results from typing SET at the command line?
I hope by this time you could have solved this problem, If not try with this. Even though u have J2ee package. You might require Servlets package to compile your program.Attached is the the jar file which consists of all the class files we need for compiling the servlets. You may need to place the jar file under c:\ or any directory and specify the location in the ClassPath. It should definitely work. Extract the Zip file and add the JAR file name in the classpath.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL