Solved

setting path and javahome from jdk and servlets

Posted on 2002-04-14
11
346 Views
Last Modified: 2013-11-24
I installed  the jdk1.3 and  javawebserver2.0 in  my sytem. I set the path as f:\jdk1.3\bin; f:\javawebserver2.0\bin;  and i set the javahome as jdk1.3;

Then i wrote a simple standalone program(hello program). it worked perfectly. then i wrote a servlet program. i tried to compile the program. i got the error.
i installed the jdk and javawebserver in F drive.
my program is in
d:\aaaa\bbbb\ccccc\Home.java (servlet program).


the error is
package javax.servlet does not exist
import javax.servlet.*;
^
package javax.servlet.http does not exist
import javax.servlet.http.*;
^
please could you help me?
thanking you
0
Comment
Question by:anmadhu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +2
11 Comments
 
LVL 2

Accepted Solution

by:
coreyit earned 200 total points
ID: 6939804
I believe that the javax.servlet package is not part of the standard jdk. Typically the package is delivered via the servlet engine your using (java web server). That application should have s jar file (servlet.jar) that contains the classes for javax.servlet and subpackages. Make sure that servlet.jar is included in your classpath for compilation.

-corey
0
 
LVL 2

Expert Comment

by:coreyit
ID: 6939805
engine your using = engine you're using
0
 
LVL 92

Expert Comment

by:objects
ID: 6940780
corey is right it is not a part of standard jdk (J2SE). It is included as a part of enterprise jdk (J2EE) available from sun.
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 1

Expert Comment

by:naveeth
ID: 6941066
try running  this as batch file before compiling

set classpath = %classpath%; f:\javawebserver2.0\lib\servlet.jar;

regards
0
 
LVL 92

Expert Comment

by:objects
ID: 6941085
thats what corey already said to try.
0
 
LVL 1

Expert Comment

by:naveeth
ID: 6941090
where is the code?
0
 
LVL 92

Expert Comment

by:objects
ID: 6941101
> where is the code?

What code??? servlet.jar just needs to be included in the classpath, and there are many ways to do this. And it doesn't necessarily even require any code, in fact the preferable solution, which is to include it in your classpath at startup, does not.
0
 
LVL 1

Expert Comment

by:naveeth
ID: 6941119
agreed,I try to added my way of setting class path ,any problem ? I am sorry
0
 
LVL 2

Expert Comment

by:coreyit
ID: 6942776
For some classpath setting guidelines, see:
http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html

-corey
0
 

Author Comment

by:anmadhu
ID: 7004692
good
0
 

Expert Comment

by:coysting
ID: 8117542
I met similar problem and solve it by adding servlet.jar offered by Tomcat to classpath.
0

Featured Post

Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question