If you are new to java and compiling your newly created program, you must be getting an error occurred during initialization of boot layer. The error is very common among the users who have just started with java, eclipse, or Hadoop. Multiple things need to be considered while compiling programs. The error doesn’t have any specific cause that can be pinpointed, user mistake is one of the major causes behind this issue. But no need to be worried. In this troubleshooting guide, we will be going through most of the scenarios and methods in which a user faces error.
Causes of Error Occurred During Initialization Of Boot Layer Problem
Talking of the possible causes behind this error. The error is common among java and eclipse usage. Although multiple users have reported that the error appears because of the java version you are using. Users have found that the 12.x version is not suitable. Furthermore, the issue is also related to classes, paths, and various other things. Users have also reported that the error occurs because Netbeans is turned on.
- Java Version Issues
- Classes, Classpath issues
- Netbeans Turned On
Similar Types of Error Occurred During Initialization Of Boot Layer Issue
- Sdkmanager
- Intellij
- Java.lang.module.findexception eclipse
- Java.lang.module.findexception: unable to derive module descriptor
- Java.lang.module.findexception: module java.activation not found
- An error occurred during initialization of VM
- Com.beust.jcommander.1.72.0: invalid module name: ‘1’ is not a java identifier
- Java.lang.module.findexception: module java.transaction not found
- Module javafx.controls not found
- Java lang module findexception module JDK hotspot agent not found
Below we have tried to cover mostly all the ways to fix this error.
1. Use Java Version Below 12.x
As reported by multiple users and one of the major reasons behind error occurred during initialization of boot layer java.lang.module.findexception: Multiple users have recommended Java 10 or Java 8 instead of Java 12. Java 12 has compatibility issues and very much to such errors.
- STEP 1. To download Java 8, open up your browser and open this link
- STEP 2. Below click on the red Download button, the download will start in a few seconds
- STEP 3. Once downloaded, install it
2. Use Command to Run Java Program
Another error occurred during initialization of boot layer java issue that comes into existence is when the user doesn’t use a command prompt to execute java codes especially if you are working with eclipse. It becomes easier to track whether the issue is with the eclipse or your java code. So it is recommended using the command prompt. Below is a little example.
- STEP 1. Open up a command window and head to where you have saved your .java program
- STEP 2. Supposes it in C: and the name of the program is MyFirst
- STEP 3. Now execute the below command to compile the code
javac MyFirst.java
- STEP 4. If there are no errors that mean, there is no issue with your java code
- STEP 5. Now after executing the above the path variable is set now
- STEP 6. To run the program execute the command below
java MyFirst
- STEP 7. Once you execute the command you will see the result on your screen
3. Turn OFF the ‘Compile on Save’
Another way users have found to eliminate the error is by turning off the ‘Compile on Save’ option in Netbeans. Users have reported that if it is turned on the eclipse error occurred during initialization of boot layer java.lang.module.findexception: module error seems to appear.
- To turn it off, head to, Project Properties > Build > Compiling
4. Miscellaneous Fixes
There are some other fixes as well, that are suggested by users, kindly go through the error occurred during initialization of boot layer eclipse guide, and check if it is working for you.
- While executing selenium codes, try removing the selenium dependencies from the ModulePath to ClassPath under Build path in eclipse
-
Users have also fixed the issue by reordering the source folder. Put it above the JRE System Library. Under Properties > Java Build Path
- Another way users have eliminated the error is by deleting all other classes except the class in which you have written your code. It can be done by going to the PROJECT folder > src > Default package
Conclusion:
In the above troubleshooting guide, we have demonstrated all the ways by which Error Occurred During Initialization Of Boot Layer can be eliminated. We have tried to cover the maximum ways to fix the issue. If you have some other way to fix the issue tell us in the comments.
For more guides and tips follow us. Thank you!
posted 4 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
I was using jGrasp to write my program, however, it was suggested I try Eclipse in one of my posts on here. My program runs in jGrasp, but I get an error when I attempt to run it in Eclipse . I have the package named Brown_5, and my class is Brown_5 (saved under the same name as well). I selected it to run in Java 10.0.2 which is what I have installed on my PC. I did attempt Java 1.8 as suggested in another form with no luck. I prefer Eclipse since it debugs as you write the code, and formats like a charm. I am just struggling with getting it to run my program. Any suggestions?
Error occurred during initialization of boot layer
java.lang.LayerInstantiationException: Package jdk.internal.jimage.decompressor in both module jrt.fs and module java.base
posted 4 years ago
-
1
-
Number of slices to send:
Optional ‘thank-you’ note:
Can you compile and run the project at the command line? I suspect it will, since it runs in jGrasp. If not, you may need to uninstall Java (and maybe all versions of Java).
Works at the command line? Then you may need to uninstall/reinstall Eclipse. Don’t remove the workspace folder.
All things are lawful, but not all things are profitable.
Elaina Brown
Greenhorn
Posts: 11
posted 4 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
It was an issue with Java. I had installed Java 11, and also had versions 10 and 8. I now just have version 10.0.2 ( it will not run with the latest version).
It works like a charm now. Thank You. Sorry for the late response.
Knute Snortum
Sheriff
Posts: 7123
posted 4 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
I’m glad you figured it out! Thanks for posting your solution.
All things are lawful, but not all things are profitable.
При попытке запустить Java-проект возникает следующая ошибка:
Error occurred during initialization of boot layer
java.lang.LayerInstantiationException: Package jdk.internal.jrtfs in both module java.base and module jrt.fs
Я попытался удалить JDK и JRE и снова установить их, но проблема все еще существует.
Может кто-нибудь объяснить, как решить эту проблему?
Может ли восстановление системы помочь?
У вас много установки jdk?
— Issam EL-GUERCH
20.09.2018 15:51
@Issam EL-GUERCH, Только один, 10.0.2
— user300045
20.09.2018 15:53
Вы можете разместить свой код?
— Matt
20.09.2018 16:04
Когда вы добавляете внешний файл .jar в новую пользовательскую библиотеку, обязательно отметьте «Путь к загрузочному классу системы».
— SidPro
01.03.2021 09:36
Версия Java на основе версии загрузки
Если вы зайдете на официальный сайт Spring Boot , там представлен start.spring.io , который упрощает создание проектов Spring Boot, как показано ниже.
Ответы
5
Я столкнулся с той же проблемой, я думаю, что это как-то связано с более новой версией Java.
При создании нового java-проекта вот картина
Щелкните версию 1.8, а затем сохраните ее, и она должна работать.
Если ваша программа работает в командной строке, проблема не в установках JDK, а в среде IDE, которой является Eclipse. попробуйте переустановить Eclipse IDE.
Сегодня я столкнулся с той же проблемой, и я попробовал «Запуск от имени -> Java-приложение». Потом это было исправлено. (кстати, я использовал jdk-11.0.2)
Надеюсь, вы найдете это полезным!
Это может произойти, если у вас есть конфигурация запуска без настроенного проекта и основного класса. Вы можете исправить это, перейдя в настройки запуска и удалив пустую конфигурацию или выбрав правильную при запуске.
Я была такая же проблема. Похоже, что зависимости от Modulepath перепутались. — перекомпоновка проекта после удаления файла Launch Configuration проекта из папки.
…workspace.metadata.pluginsorg.eclipse.debug.core.launches и удаление каталога bin устранили проблему.