Will Hopkins Will Hopkins - 6 months ago 22
Java Question

How to determine entry point of java with long classpath

Hi I am not a java programmer but am trying to debug someone else's code.

I have windows bat file with java.exe -classpath followed by a very lengthy list. How do I find which java program is the entry point -- or in other words what the heck actually executes?

As requested here is the first part of the command

C:\DSUpload\java\bin\java.exe -classpath C:\DSUpload.adf;C:\DSUpload\classes;C:\DSUpload\wlserver_10.3\server\lib\weblogic.jar;

Answer

The java class file will probably be the last part of the command, if not, then it will be the only part of the command that is not preceded by a flag/option.

Example:

java -cp foo;bar;baz JavaClass

Here, "JavaClass" is the class being run, as it is below:

java -cp foo;bar;baz JavaClass -d someDir

The entry point of a java program is always its "main" method, which has the following signature (the parameter name can vary):

public static void main(String[] args)
Comments