Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error message (package com.example.model does not exist)

 
vinayak manda
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope most of you all might have worked with the BeerSelect.java and BeerExpert.java examples from HFS.

I was doing well until I compiled the BeerExpert.java,but when I made the changes in BeerSelect.java as given on page 84,and when I compiled it on cmd prompt I get :

C:\MyProjects\beerV1>javac -d classes src\com\example\web\BeerSelect.java
src\com\example\web\BeerSelect.java:2: package com.example.model does not exist
import com.example.model.*;
^
src\com\example\web\BeerSelect.java:16: cannot resolve symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be = new BeerExpert();
^
src\com\example\web\BeerSelect.java:16: cannot resolve symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be = new BeerExpert();
^
src\com\example\web\BeerSelect.java:19: cannot resolve symbol
symbol : variable it
location: class com.example.web.BeerSelect
while(it.hasNext()) {
^
src\com\example\web\BeerSelect.java:20: cannot resolve symbol
symbol : variable it
location: class com.example.web.BeerSelect
out.print("<br>try : " + it.next());
^
5 errors

I would like to mention that I had created a dummy workspace in my IDE which has the same flow of the packages and java files as given in HFS,they work well.

Then why am I facing this problem........where am I going wrong.

Thanks.
 
vinayak manda
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please ignore the post ,am out of the bug with the help of Javaranch FAQ
 
kasey mccurdy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey ther....can you post what you ended up fixing? ive changed the classpath a million times...and nothing.....gettin frustrated
 
kasey mccurdy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
holy hell...i just found it....damn 5am java cram sessions....u miss the littlest things....i had the classpath pointing to the wrong dir....
 
Mitch Bach
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also having problems with this example. The issues I am having are identical to Vinayak's so I will no bother reposting system output. Where in FAQ is the solution? I could use a step by step in setting up the correct classpath for this example and correct command line instructions.

Thanks
 
Brent Collier
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am have the same problem and its infuriating me. My CLASSPATH is current set to this: G:\Documents and Settings\Brent\My Documents\Projects\beerV1\classes

Is there something special that I need to do to my classpath because of the "Documents and Setting" and the "My Documents" directories? I'm wondering if the spaces in the directory names are causing a problem.
 
Brent Collier
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind...

I found the answer in another topic. The compile command in the book used ":" instead of ";".

Thanks JavaRanch!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic