Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in compilation

 
deshdeep divakar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have developed a servlet,problem i m facing
are 1. it is not importing the packages.

tell the appropriate method to compile nd run a servelet
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deshdeep,

What is your classpath set to? How exactly are you compiling your servlet?

Regards,
Saket
 
Sarath Mohan
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems you need to keep servlet-api.jar in your classpath. This will make the class to compile. Now in oreder RUN the servlet you require a servlet container like Tomcat or JRun

Visit http://java.sun.com/products/servlet/ for more resources

Regards
 
deshdeep divakar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi this is a problem related to compilation of the servlet program.
classpaths are set as: c:\jdk1.4\lib\dt.jar;
c:\jdk1.4\lib\htmlconverter.jar;
c:\jdk1.4\lib\tools.jar;
c:\jdk1.4\lib\servlet-api.jar;
but on compiling the servlet in command prompt by javac compiler the error is the packages of servlet and servlet.http. do not exist.
there is no problem in running applet.
 
Girish Babu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

in your command prompt before doing javac type this and try:

set classpath=%classpath%;c:\jdk1.4\lib\servlet-api.jar;.;

then compile,

still if it is not compiling then let us knw the web-server u r planning to host your servlet on, may be someone can help you,

Girish
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic