?
Solved

setting path and javahome from jdk and servlets

Posted on 2002-04-14
11
Medium Priority
?
347 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 600 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month12 days, 2 hours left to enroll

752 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