Search code examples
javaentry-point

Internal process for launching a main entrypoint of a class


I am curious about the whole process behind the public static void main(args[]) launching in a Java class.

If some one could points me to some classes involved in the JDK code source ?

I want to know about the process in details.

I don't know where to start !


Solution

  • I believe here the main method is called (execution of CallJavaMainInNewThread method): src/java.base/share/native/libjli/java.c Line 2361

    CallJavaMainInNewThread declaration: src/java.base/share/native/libjli/java.h Line 161

    CallJavaMainInNewThread implementations for particular platforms:

    OpenJDK source code repository: https://github.com/openjdk/jdk/