Click to See Complete Forum and Search --> : Compiler cries at : java.awt.geom.*;


HappyGoLucky
December 19th, 2002, 09:11 PM
Can someone help me out. I am trying to compile my java code, but it does not like line 13 below. It looks like maybe it can not find the geometry package? I am using JavaSDK 1.4.4 and Forte For Java as the IDE. Any help is appreciated.





13 package java.awt.geom.*;
14
15 public interface Moveable {
16
17 public boolean collidesWith(Moveable other);
18 public void processCollisions();
19 public void update();
20 // Moveable
21 }


Error Message from compiler:


package java.awt.geom.*;

^

Errors compiling interface Moveable

wayne0101
December 20th, 2002, 09:15 AM
i think, you have to write "import" instead of "package". what package means is the name of the package of classes you are writting. import means the packages you want to use in your class.

cu
wayne

dlorde
December 20th, 2002, 09:17 AM
That's not a valid package statement. You can't use '*' as a package element ('*' isn't a valid directory name, either). You also should not attempt to add your own classes to the standard Java packages.

However, I'm guessing you wanted to import that package, so you should use the 'import' keyword, not the 'package' keyword.