-
Bug
-
Resolution: Unresolved
-
P4
-
25
The native code in the java launcher, takes help from a JDK internal class sun.launcher.LauncherHelper. The native code invokes on the LauncherHelper.checkAndLoadMain() to determine the entry point and few other additional details that are needed by the launcher. The LauncherHelper when it is invoked to determine the relevant main method entry point for the application, does all the necessary reflective lookups and validations before determining the correct main method to invoke.
The return type of the LauncherHelper.checkAndLoadMain() method is a Class<?> which represents the main class that needs to be launched by the launcher. The LauncherHelper, before returning from checkAndLoadMain() call, will also have stored a few other details about the main entry point as static field values in the LauncherHelper class.
In the current implementation, even when the LauncherHelper has done all the necessary work to narrow down the main method and other details relevant to the main method, because of the way it's currently implemented, the native launcher code ends up doing additional reflective lookups trying to find the "right" main method and in some cases the "right" constructor (in functions like invokeInstanceMainWithArgs, invokeStaticMainWithArgs, invokeStaticMainWithoutArgs, invokeInstanceMainWithoutArgs).
The code in the launcher and the LauncherHelper can be cleaned up to reduce this back and forth and simplify the interaction.
The return type of the LauncherHelper.checkAndLoadMain() method is a Class<?> which represents the main class that needs to be launched by the launcher. The LauncherHelper, before returning from checkAndLoadMain() call, will also have stored a few other details about the main entry point as static field values in the LauncherHelper class.
In the current implementation, even when the LauncherHelper has done all the necessary work to narrow down the main method and other details relevant to the main method, because of the way it's currently implemented, the native launcher code ends up doing additional reflective lookups trying to find the "right" main method and in some cases the "right" constructor (in functions like invokeInstanceMainWithArgs, invokeStaticMainWithArgs, invokeStaticMainWithoutArgs, invokeInstanceMainWithoutArgs).
The code in the launcher and the LauncherHelper can be cleaned up to reduce this back and forth and simplify the interaction.
- relates to
-
JDK-8328995 Launcher can't open jar files where the offset of the manifest is >4GB
-
- Open
-
-
JDK-8339332 Clean up the java launcher code
-
- Closed
-
- links to
-
Review(master) openjdk/jdk/21256