Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compilation error

 
Sanjay pts
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
all
Im trying to write servlet of HFS&J pg 84.But was unable to coplite as give me error that cant import package com.example.model

I know its a problem with classpath so can anybody tell me how can i compile that.
thanx
sanjay
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sanjay,

How are you setting the classpath? Or, are you providing the concerned package whilst compiling your source files?

Please give us more details.

Regards,
Saket
 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use javac -classpath .:<where-ever>/servlet-api.jar

If you are using Windows replace : with ; and / with \
 
rakeshBhatia
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sanjay,

I had the same problem. I had to include path for my webapps\myapp\src folder as well because thats where com\ resides.

Regards,

Raj
 
Sanjay pts
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i set classpath like this

set classpath=C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\Beer-v1\WEB-INF\classes\

and then compile and it works fine

Cheer up
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic