• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need Help  RSS feed

 
priyanka s
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i m not able to compile the program from hands-on MVC(chapter3) of head first JSP n servlets. it throws the foll error when i try to compile BeerSelect.java :

---------- Compile ----------
C:\MyProjects\beerV1\src\com\example\web\BeerSelect.java:3: package com.example.model does not exist
import com.example.model.*;
^
C:\MyProjects\beerV1\src\com\example\web\BeerSelect.java:19: cannot resolve symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be=new BeerExpert();
^
C:\MyProjects\beerV1\src\com\example\web\BeerSelect.java:19: cannot resolve symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be=new BeerExpert();
^
C:\MyProjects\beerV1\src\com\example\web\BeerSelect.java:20: cannot resolve symbol
symbol : class List
location: class com.example.web.BeerSelect
List result =be.getBrands(c);
^
4 errors
Output completed (0 sec consumed) - Normal Termination

My CLASSPATH is set to :
C:\jakarta-tomcat-5.0.28\common\lib\servlet-api.jar;C:\jakarta-tomcat-5.0.28\common\lib\servlet-api.jar

As i m new to this forum, i dont know where to look out for the pointers for the same.
Please help !
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"priyanka s",
Welcome to JavaRanch!

We're pleased to have you here with us in the servlets forum, but there
are a few rules that need to be followed, and one is that proper names are
required. Please take a look at the
JavaRanch Naming Policy and
adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here

Also,
in an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
UseAMeaningfulSubjectLine

Again, welcome to JavaRanch and good luck with your question.
-Ben
 
Sunil Vasudevan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keep the current working directory also in the classpath.

.;C:\jakarta-tomcat-5.0.28\common\lib\servlet-api.jar;C:\jakarta-tomcat-5.0.28\common\lib\servlet-api.jar

Since your code exist in a package structure, you need to compile your code from C:\MyProjects\beerV1\src folder.

C:\MyProjects\beerV1\src>javac com/example/web/BeerSelect.java

For more information, check: http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!