File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Compiler error when sorting. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compiler error when sorting." Watch "Compiler error when sorting." New topic
Author

Compiler error when sorting.

michael bradly
Ranch Hand

Joined: Oct 06, 2000
Posts: 112
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

Joined: Oct 05, 2000
Posts: 62
Seems to be classpath problem. Have you set the classpath to the parent directory of the package?


Pravin R Panicker<br />SCJP,SCWCD
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
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

Joined: Oct 06, 2000
Posts: 112
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

Joined: Mar 02, 2000
Posts: 3143
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?


Pounding at a thick stone wall won't move it, sometimes, you need to step back to see the way around.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiler error when sorting.