Question: how to fix error occurred during initialization of boot layer?
Answer: In order to eliminate this, go to the PROJECT folder → src → Default package. Keep only one class (in which you had written code) and delete others. After that, run your program and it will definitely run without any error. I faced same problem when I updated the Java version to 12.