Your problem is that import your.package.*
works only for classes in your.package
. It means that it will not import classes from its subpackages like your.package.exceptions
. To import them you need to create separate import. Try with
import MyProject.*;//this can import LinkedList and MyIterator
import MyProject.MyExceptions.*;// this can import Exception1 and Exception2
//rest of your code