Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsError message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1809203/#msg_1809203
error occurred during initialization of boot layerjava.lang.module.findexception: error reading module: c:\coderepository\myproject\bincaused by: java.lang.module.invalidmoduledescriptorexception: myclass.class found in top-level directory (unnamed package not allowed in module)]]>Sergeant Smiley2019-07-11T12:47:38-00:00Re: Error message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1809213/#msg_1809213
Nitin Dahyabhai2019-07-11T16:47:12-00:00Re: Error message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1814019/#msg_1814019
java.lang.module.InvalidModuleDescriptorException:
I saw an answer on the forum but I am new to eclipse and haven't programed in Java in a couple of years (BlueJ), in other words I didn't understand the answer. I need baby steps please.
]]>MICHAEL DAVIS2019-09-01T19:15:43-00:00Re: Error message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1814050/#msg_1814050
https://www.vogella.com/tutorials/Eclipse/article.html]]>Ed Merks2019-09-02T10:13:56-00:00Re: Error message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1855082/#msg_1855082
]]>Nicolae FIERARU2022-09-28T03:42:56-00:00Re: Error message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1855102/#msg_1855102
https://github.com/eclipse-jdt/eclipse.jdt.ui
]]>Ed Merks2022-09-28T15:08:39-00:00Re: Error message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1855105/#msg_1855105
However, at least my 2022-09 JDT complains of missing package declaration as soon as the source is opened in the editor, see the red error mark at top left.
]]>Tauno Voipio2022-09-28T17:06:53-00:00Re: Error message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1860928/#msg_1860928
As a Java newbie, I find your answer challenging to understand operationally.
In other words, I am unclear of the implementation.
What are the concrete steps you are recommending? ]]>THOMAS DOWNES2023-09-09T19:39:58-00:00Re: Error message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1860930/#msg_1860930
module-info.java.
(This is a default file, but I don't know how to change the setting to not have it be automatically included in your project.)
Solution, right-click & delete the file ("module-info.java").
(See attached image.)
(Credit to Nitin Dahyabhai for his helpful suggestion!!)]]>THOMAS DOWNES2023-09-09T20:05:40-00:00Re: Error message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1860931/#msg_1860931
(See attached image.) ]]>THOMAS DOWNES2023-09-09T20:07:41-00:00Re: Error message run I tried to run the hello world in java
https://www.eclipse.org/forums/index.php/mv/msg/1099691/1860932/#msg_1860932
You are looking at the "Create New Class" dialog. Let's take a look at the "Create New Project" dialog instead. See image. As I mention in the image, the Create New Project dialog probably has "Create Module Info" (?) automatically checked.
Having "Create Module Info" checked seems to create extra work for the programmer. It seems to cause the compiler to expect that a "package" (whatever that means!) will be specified by the programmer (you & me).
When the new project is created, you'll see a file called "module-info.java" has been automatically added under the "src" folder.
That file ("module-info.java") is the problem. It puts the compiler into a "check package" mode (just a guess, as I don't really know what's going on).
Comment out the one-line command in that file, or right-click the file (from within the Project Explorer (?) and select "Delete" (to remove the module-info.java file from the project).
This worked for me, just within the last 20 minutes when I tried it out. Good luck!!