aspose file tools*
The moose likes Java in General and the fly likes Package ... not found errors with 1.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Package ... not found errors with 1.4" Watch "Package ... not found errors with 1.4" New topic
Author

Package ... not found errors with 1.4

Dale Lobach
Greenhorn

Joined: Apr 18, 2001
Posts: 4
I just installed 1.4.0_01 and am having problems importing class files in the same directory.
If I have xyz.class (simple utilities compiled with 1.4.0_01) in the same directory as the current program, and I use:
import xyz.*;
in the current program, I get the error "Package xyz.class does not exist." This is new to 1.4. I've not seen this in previous versions. I've tried setting the CLASSPATH, eliminating the CLASSPATH, checked the PATH,... and I'm having no luck getting 1.4 to find the external class. Help is appreciated.
Thanks,
Dale L
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
"import xyz.*;" means bring in all the classes in the xyz directory or package. You don't HAVE an xyz directory from your description.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
Originally posted by Dale Lobach:
If I have xyz.class (simple utilities compiled with 1.4.0_01) in the same directory as the current program, and I use:
import xyz.*;
in the current program, I get the error "Package xyz.class does not exist."

If you want to import a class, I think you would use
import MyClass ;
not
import MyClass.* ;

but that won't solve your problem. Refer to this thread which in turn refers to this thread for a discussion of this development which is new to jdk1.4.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Dale Lobach
Greenhorn

Joined: Apr 18, 2001
Posts: 4
Thanks for the responses. I just grumbled and started moving things to a package.
Thanks,
Dale L
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Package ... not found errors with 1.4