Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » A Newbie's ??(Building the HelloWorld Cheat Sheet Example)
A Newbie's ?? [message #1853034] Wed, 15 June 2022 13:52 Go to next message
David C Mace is currently offline David C MaceFriend
Messages: 2
Registered: June 2022
Junior Member
followed the steps in the cheat sheet for HelloWorld
getting a HelloWorld.class in the /bin dir

HelloWorld.java code is

public class HelloWorld {

public static void main(String[] args) {
// TODO Auto-generated method stub

System.out.println("Hello world!");

}

}


get the following error
"Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: C:\Users\Public\Athena\eclipse-workspace\HelloWorld\bin
Caused by: java.lang.module.InvalidModuleDescriptorException: HelloWorld.class found in top-level directory (unnamed package not allowed in module)"

the [b]module-ingfo.java[/b }that was created has this in it
module HelloWorld {
}

What am I missing ?
Re: A Newbie's ?? [message #1853046 is a reply to message #1853034] Wed, 15 June 2022 17:29 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 139
Registered: October 2018
Senior Member
Hi,

Try to create a package (e.g. mypackage ) and move your class to it (you can use refactor).

or

delete module-info.java if you have one.

Regards.




Re: A Newbie's ?? [message #1853047 is a reply to message #1853046] Wed, 15 June 2022 18:09 Go to previous messageGo to next message
David C Mace is currently offline David C MaceFriend
Messages: 2
Registered: June 2022
Junior Member
delete module-info.java worked
thanks very much

deleteing module-info.class alone did not
but deleting module-info.java as well did

To continue
1) what is the module-info supposed to do ????

david mace


Re: A Newbie's ?? [message #1853048 is a reply to message #1853047] Wed, 15 June 2022 18:39 Go to previous message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 139
Registered: October 2018
Senior Member
You are welcome,
May I suggest some reading first.
https://docs.oracle.com/javase/tutorial/

At this stage, I think that you can skip module-info.java
Search for module-info.java later on.

Also, I sugest you start using packages you can read about it in the The Java™ Tutorials .

Regards.
Eitan.




Previous Topic:Incorrect console encoding under Windows 11
Next Topic:Eclipse Needs a Better way of configuring Compilers
Goto Forum:
  


Current Time: Tue Apr 16 06:52:46 GMT 2024

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

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

Back to the top