OCP Java SE 11 Programmer I Study Guide(Boyarsky and Selikoff ), Chapter 11 - Page 466 (Order Matters!)
as per the text in book, while compiling the module using javac command, order of the java files matters. module-info.java can not be listed as first file if module is exporting some package and there is no class file exist for the package.
I ran the command with module-info.java as the first file, without any exported package/class file already existed and not getting the error.
The order of source files specified on the command line or in an argument file is not important. javac will compile the files together, as a group, and will automatically resolve any dependencies between the declarations in the various source files.