• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please ignore the post ,am out of the bug with the help of Javaranch FAQ
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nevermind...

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

Thanks JavaRanch!
 
reply
    Bookmark Topic Watch Topic
  • New Topic