The directory structure is not correct.
src/com/test/MyTest.java
-> MyTest.java is interpreted as a class of package com.test cause src is the source folder (=default package).
If you are using com as a sourcefolder, then MyTest is interpreted to be in package test. And if the package statement of the source/class file says com.test is the correct one, then you’ll get an error like yours.
Just check if your linked resources/source folders target the right directory.