What happens when java program starts?

后端 未结 4 1428
予麋鹿
予麋鹿 2021-02-02 02:42

Recently have been touched Java classloaders and suddenly recognized that do not fully understand what happens step-by-step when someone calls

j         


        
4条回答
  •  终归单人心
    2021-02-02 03:38

    Your example shows an executable jar, which is simply a normal java archive (jar) with an extra key/value pair in it's manifest file (located in folder "META_INF"). The key is "Main-Class" and the value the fully qualified classname of that class whose "main" method will be executed, if you "run" the jar just like in your example.

    A jar is a zip file and you can have a look inside with every zip archive tool.

提交回复
热议问题