package book; import cert.*; // Import all classes in the cert package class Goo { public static void main(String[] args) { Sludge o = new Sludge(); o.testIt(); } } Now look at the second file: package cert; public class Sludge { public void testIt() { System.out.println("sludge"); } }
I placed Goo.java in the folder c:\scjp\book & the Sludge.java in c:\scjp\cert
Even though i successfully compiled Sludge.java Im unable to compile Goo.java
The error was "package cert does not exist"
I think the trick is behind classpath, how to fix it? thanks in advance.
live
wise owen
Ranch Hand
Joined: Feb 02, 2006
Posts: 2023
posted
0
try this
raja kanak
Ranch Hand
Joined: Oct 18, 2006
Posts: 135
posted
0
thank you, wise owen
it compiles perfectly.
Now i try to run from the folder c:\scjp\book\ like c:\scjp\book\java Goo