Win a copy of Penetration Testing Basics this week in the Security forum!

Compile Error - J2EE 1.4 SDK

Sri Gnana
Ranch Hand
Posts: 166
Hi
I have installed J2EE 1.4 SDK and I'm trying to compile the servlet file, but it's showing the compile time error's 1.Package javax.servlet.http does not exist and 2.cannot resolve symbol. I think I didn't set path correctly, can any one help me out and give me the possible way to compile the servlets.If the problem is with the path, please give me the details for setting the path.

Gert Cuppens
Ranch Hand
Posts: 87
This error depends in which environment you are compiling the servlet. Many free IDE's need to know where you've placed the jar-files containing the classes you're using. For example, under Eclipse the classpath variables can be viewed with the menu options Windows - preferences - Java.

If you're using another IDE or even if you're using a DOS box, then it will be different. So, in which environment are you compiling your servlets ?

Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35055
380
Sri,
In particular, you need to put one of servlets.jar or j2ee.jar in your classpath. This can be done as a command line switch or in the CLASSPATH environment variable.

Bosun Bello
Ranch Hand
Posts: 1511
You can also copy one of the above mentioned jar files to "your jdk directory\jre\lib\ext\"