Today, when I was learning elasticsearch, I didn’t want to run elasticsearch.bat. As a result, soon after running, there was no black frame, only a flashback. I guess it was too fast. I don’t even have a black box. I can’t see any error information.
So I used CMD in the bin directory, as shown in the figure
Then execute the elasticsearch.bat file
Then you can see the error message error occurred during initialization of VM, error occurred during initialization.
Solution: I found Java_Home in my environment variable actually disappeared. Although I can still see the information by typing Java in the CMD window, it just disappeared. I guess it may be related to its disappearance, so I re-created Java_Home, locate the current Java directory, and start elasticsearch.bat again. It starts successfully!