Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java Dummies Book : EchoLine(Runtime error)
Java Dummies Book : EchoLine [message #1795240] Wed, 19 September 2018 02:36
Henrick Leow is currently offline Henrick LeowFriend
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
Previous Topic:My Eclipse Error
Next Topic:Java Dummies Book : EchoLine
Goto Forum:
  


Current Time: Sat Apr 27 04:40:10 GMT 2024

Powered by FUDForum. Page generated in 0.02718 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top