Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Error occurred during initialization of boot layer
Error occurred during initialization of boot layer [message #1834578] Thu, 12 November 2020 16:39 Go to next message
Andreea Predi is currently offline Andreea PrediFriend
Messages: 1
Registered: November 2020
Junior Member
I wanted to run the Hello World code in Java, but the following error has appeared:

Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: C:\Users\Ioana Predi\eclipse-workspace\Project1\bin
Caused by: java.lang.module.InvalidModuleDescriptorException: MyClass.class found in top-level directory (unnamed package not allowed in module)

This is the code I tried to run:


public class MyClass {

public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello World!");
}

}


My Java version is this:

javac 15.0.1.

How can I fix it?
Re: Error occurred during initialization of boot layer [message #1834588 is a reply to message #1834578] Fri, 13 November 2020 03:00 Go to previous messageGo to next message
Manoj Palat is currently offline Manoj PalatFriend
Messages: 18
Registered: October 2014
Junior Member
Hi,
I believe you have a module defined here [check for a module-info.java file]. You must have got a compilation error in this case "Must declare a named package because this compilation unit is associated to the named module 'test'" as per Java Language Specification version 15, sec 7.4.2 "The host system must associate ordinary compilation units in an unnamed package with an unnamed module (ยง7.7.5), not a named module." Trying to run this program should have resulted in this error.

So either (1) remove this module-info.java file if you don't want your project associated with a module or (2) create a package, say pack1 and move this class into that and compile

package pack1;
public class MyClass {

public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello World!");
}

}

Regards,
Manoj


Manoj N Palat
Eclipse Java Development Tools (JDT).
Re: Error occurred during initialization of boot layer [message #1838802 is a reply to message #1834588] Fri, 05 March 2021 09:28 Go to previous message
Zoheth  George is currently offline Zoheth GeorgeFriend
Messages: 1
Registered: March 2021
Junior Member
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for C:\Users\zoheth\eclipse-workspace\Beat\lib\rs2xml.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: JDOMAbout$Author.class found in top-level directory (unnamed package not allowed in module)


how to remove this error?
Previous Topic:Starting up badly in Windows 10
Next Topic:What version of Java for compiler?
Goto Forum:
  


Current Time: Tue Apr 13 05:47:49 GMT 2021

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

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

Back to the top