Java Dummies Book : EchoLine [message #1795240] |
Wed, 19 September 2018 02:36 |
Henrick Leow Messages: 5 Registered: September 2018 |
Junior Member |
|
|
I follow the dummies book and i written :
import java.util.Scanner;
class EchoLine {
public static void main(String args[]) {
Scanner keyboard = new Scanner(System.in);
System.out.println(keyboard.nextLine());
keyboard.close();
}
}
The error shown :
Must declare a named package because this compilation unit is associated to the named module 'MyNewProject'
The console tab shown :
Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: C:\Users\Leow\myfirst-eclipse-workspace\MyNewProject\bin
Caused by: java.lang.module.InvalidModuleDescriptorException: EchoLine.class found in top-level directory (unnamed package not allowed in module)
Anyone can advise what wrong ?
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.03579 seconds