• 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

Compiler error when sorting.

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm following an example in my text book "Java Software Solutions" -page 289- and am getting an error:
"cannot resolve symbol
symbol: class Sorts
import Sorts"
when compiling.
I've seached through the Sun documentation as best I could and did not find anything under a search for import Sorts. Is import Sorts; valid?
Regards, Michael
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems to be classpath problem. Have you set the classpath to the parent directory of the package?
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michael,
import Sorts; is only valid if you have a file called Sorts.class in the same directory as the example you are trying to compile.
Regards,
Manfred.
 
michael bradly
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So my understanding is that the example in the book is using a class as defined by the Authors/3rd Party and is not part of the JDK, hence the compilers inability to find it.
If that is the case I think I can find where their class is and install it. Thanks.

Originally posted by Manfred Leonhardt:
Hi Michael,
import Sorts; is only valid if you have a file called Sorts.class in the same directory as the example you are trying to compile.
Regards,
Manfred.

 
Ranch Hand
Posts: 3143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which book are you using and where is the example??
Usually if another class is referred to in an example it one was was defined in a previous example in the same Chapter ... take a look if there is another example in the Chapter that uses a class called Sorts?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic