• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiler error when sorting.

 
michael bradly
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • 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
 
Pravin Panicker
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems to be classpath problem. Have you set the classpath to the parent directory of the package?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Angela Poynton
Ranch Hand
Posts: 3143
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic