Skip to content

How to fix “error occurred during initialisation of boot layer” in Eclipse?

  • by
  • 3 min read

Java runs on millions of devices ranging from car stereos to modern smartphones. It’s also one of the most popular programming languages that’s very easy to learn even for complete beginners to the field, and runs on a range of devices lowering the entry barrier.

However, as easy as Java is to learn, it can also throw random errors at times, leaving even experienced developers scratching their heads. In this article, we’re talking about how to fix the “error that occurred during the initialisation of the boot layer” in Ecliples IDE when working with Java.

What causes the “error occurred during initialisation of boot layer” error?

The error generally occurs due to either incorrect Eclipse configuration or the developer has accepted the prompt to create a default class as prescribed by Eclipse but has written their code in their own class. This means that JVM cannot compile the code as there are now two conflicting classes in the script. 

Also read: Fix: Java.lang.outofmemoryerror: gc overhead limit exceeded

How can the “error occurred during initialisation of boot layer” be fixed?

The solution for this is rather simple. Here’s what you need to do. 

Step 1: Right-click your project in Eclipse and select Build Path, followed by Configure Build Path.

Step 2: Select the Libraries tab under the Java Build Path section in the menu that pops up. Click JRE System Library and then the Remove button. 

Step 3: Now click Modulepath followed by Add Library. 

Step 4: In the next menu, select JRE System Library and click Next. 

Step 5: Select the Execution environment radio button and then Finish. 

Step 6: Finally, click Apply and Close in the bottom right. Now, your program should be built and run without any errors.

If the problem persists, try removing any additional dependencies you might not be using or installing properly so that JVM and Eclipse know where it’s installed and can refer to them properly when compiling your program. 

Also read: Fix: Java error: Release version 19 not supported

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here:

Exit mobile version