Solved

setting path and javahome from jdk and servlets

Posted on 2002-04-14
11
345 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
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert from a json string array to a Java object 3 65
Eclipse Help Java EE 5,6,7 Documentation, why not Java EE 8 8 46
Setup GlassFish 4 37
junit example issue 2 28
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…
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…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

730 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