I too am having trouble with packages.
I write something like:
package uk.co.mywebsite;
at the top of my file and then create on the HD the folder uk, with the subfolder, co, with the subfolder mywebsite
The compiler can't find it.
I have added C:\ to autoexec.bat (I'm running Win 98)and my understanding was that the compiler started at one of the points stated in autoexec.bat and then followed the package name down substituting a backslash for the point...
I also tried the following from Bruce Eckel's tutorial:
package mypackage;
public class MyClass
{
public void prt(
String s)
{
System.out.println(s)
}
}
and saved it as MyClass.java. I didn't compile it.
Then I created:
import mypackage.*;
public class Test1
{
public static void main(String[] args)
{
MyClass m = new MyClass();
m.prt("hello");
}
}
I saved this in the same directory as the other file and I get the following:
Package mypackage not found in import.
import.package.*;
I'm doing something wrong: what is it? Let me know if you need more information