| 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: 3011
|
|
|
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.
|
 |
 |
|
|
subject: Import Problems
|
|
|