Will Hopkins
Will Hopkins

Reputation: 75

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;

Upvotes: 0

Views: 262

Answers (2)

Patrice Gagnon
Patrice Gagnon

Reputation: 1464

If you don't specify a class name to execute, then you must specify a -jar which will contain a Manifest that that a main-class attribute (main class which will be the entry point).

Upvotes: 0

SamTebbs33
SamTebbs33

Reputation: 5647

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)

Upvotes: 1

Related Questions