Recently have been touched Java classloaders and suddenly recognized that do not fully understand what happens step-by-step when someone calls
java -jar App.jar
Well I guess
- a new instance of JVM is created
- it uses ClassLoader to load main class and other classes
- byte-code is started to execute from main() method
But still I suppose there are many things I need to know more about it.
- Who and how decides which classes should be loaded at startup and which once needed?
I have found two related questions but there it is not explained how to apply that to Java realities.