aspose file tools*
The moose likes Beginning Java and the fly likes Import Problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Import Problems" Watch "Import Problems" New topic
Author

Import Problems

Sunil Chandurkar
Ranch Hand

Joined: Jan 09, 2008
Posts: 37
I have two folders with classes under the C:\Java folder.
C:\Java\Fava\Hi.java and C:\Java\Mava\Tester.java.
Tester.java has the statement
import package Fava.*;

When i try to javac Mava\Tester.java i get an error saying
<identifier expected>
import ^ package Fava.*;

How should I change the classpath under system variables to solve this problem?

Please Advise.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3682
    
  16
Remove the word 'package'. It's not needed


Joanne
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Your code has a syntax error, that's why you got the compilation error. It should be

Since you need to import the class from Fava package, you need to specify the classpath, e.g.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Your code has a syntax error, that's why you got the compilation error. It should be

Since you need to import the class from Fava package, you need to specify the classpath, e.g.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Import Problems