Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

error compiling a servlet

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

I am getting an error message while compiling a servlet which is package java.servlet does not exist import javax.servlet*;
am using tomcat5.0 and j2sdk1.4-0..
i have set my path in the user variable as follow:
path c:\jdk\bin(i hav renamed the j2sdk)

and in the system variable i have defined:]
CATALINA_HOME C:\java\tomcat-5.0
CLASSPATH C:\CATALINA_HOME\common\lib\servlet-api.jar
JAVA_HOME C:\jdk

please help
xtremely urgent
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,
I think u have wriiten there javax.servlet*;
It should be javax.servlet.*;
That's why u are getting error for servlet package does not exist.Try this out,and then tell me.Is it ok...
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello
the above solution is correct but if it is not working then let me know
bye
gaurav
 
mazoun yusuf
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for replying gentleman

i have written the servlet right.i wanted to know if the path and classpath are correct?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's finding javac so your path is right.

It's not finding the servlet classes so either you haven't written the import statement correctly, as John suggested, or your classpath is not right.
 
mazoun yusuf
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. i have corrected the errors.however am still not being able to compile.what classpath should i use?

2. in what folder should i put the class files in my tomcat directory?

3. what changes do i have to make in the web.xml file?

(it should be noted that one class files calls for another one which inturn calls for another one)

thanks in aDVANCE
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Maz-dues"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark
 
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic