File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes problem with import statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "problem with import statement" Watch "problem with import statement" New topic

problem with import statement

hesham katon
Ranch Hand

Joined: Dec 18, 2002
Posts: 82
Hello All
I was using J2SDK1.3 and I just upgraded to J2SDK1.4.2
Then i had a problem with my classes which were compiled correctly before .
I simply import a java class which is not in any package , it's directly under /classes folder , and it was working proberly in the last version of java .
this is my import statement :
import DBUtilities;
and this is the compilation result error :
'.' expected
import DBUtilities;
I wish anyone can help
thanks alot

Hesham Katon<br />SCJP 1.2<br />SCWCD 1.4<br />Better to light a candle than to curse the darkness
Billybob Marshall
Ranch Hand

Joined: Jan 27, 2004
Posts: 202
1.4 discourages the usage of importing non-packaged classes. Remove the offending import statement, which was never needed to begin with.
That said, you should always put your classes in packages anyway, as you'll discover that other classes in packages will not be allowed access to your non-packaged classes in 1.4
hesham katon
Ranch Hand

Joined: Dec 18, 2002
Posts: 82
Thank you Billybob very much
I agree. Here's the link:
subject: problem with import statement
It's not a secret anymore!