I created new Java module from scratch in my project. \"create \'src\' folder\" was selected in module creation wizard. There is single \"com\" package in source folder which co
If a class within a package is dependent on another class in the package, you need to create a classpath. Otherwise, the compiler does not know that the other class actually exists. Your IDE probably knows inherently that the classes are in the same package, which is why it isn't showing any errors.
You can resolve this issue most simply by supplying both classes as arguments to the compiler (I'm not familiar with the tool you're using to compile so this may not be possible), or by compiling a class outside the package that imports package 'com'. Both of these will create the classpath file along with the class files.