-1

I am trying to find where the entry point is of a large application, but I was told that it doesn't use a main class. I'm able to run and build the application, and I know that the classes and methods are executing when I make small changes.

However, now I'm trying to embed a new class and I can't seem to find the entry point where these classes are called. Is there a way to find out where that is, so I can call this new class I created at run time? Thank you.

Tiffany
  • 103
  • 5
  • 8
    Please tell us more about this Java application. Is it a web app, a console app, a Swing application, Android, something else? – Tim Biegeleisen Dec 13 '18 at 10:28
  • Java application can't run without entry-point. Is it a service(does java application use service wrapper service to run)? – WGSSAMINTHA Dec 13 '18 at 10:33
  • @TimBiegeleisen It is an internal computer software application hosted on private cloud. I usually commit and push the changes, then run a build on Jenkins specifying the repository and it builds the war file and deploys to the cloud environment. I was advised to run it this way instead of locally since it's simpler, and I've had a look at the logs of the build but it doesn't show which class is called etc. Hope that helps? Thank you for getting back. – Tiffany Dec 13 '18 at 11:02
  • @WGSSAMINTHA Yes I know it has to run with an entry point, my question is _where_ can I find that. I'm not sure what you mean by a service wrapper? But it is a service indeed, our clients download the application with the URL. – Tiffany Dec 13 '18 at 11:08
  • 2
    `builds the war file` for anyone still reading. – Tim Biegeleisen Dec 13 '18 at 11:10
  • In case of a web application that runs on some kind of web server, check your servlet configuration (web.xml). See https://stackoverflow.com/questions/809775/what-does-the-servlet-load-on-startup-value-signify for details on how to interpret the values there. – Hulk Dec 13 '18 at 11:29
  • For more general information about servlet containers and how they work, see https://stackoverflow.com/questions/3106452/how-do-servlets-work-instantiation-sessions-shared-variables-and-multithreadi?noredirect=1&lq=1 – Hulk Dec 13 '18 at 11:35

2 Answers2

0

its difficult to map this question because I do not know what you are building. But if its web application:

  • Start looking at the entry Servlets and start seeing the classes that are being called that may have some service related to what you build.
  • Also start looking at classes which has services it may be there, then again I'm not sure what you are building.

If its a client application FX,Swing and other you should look trough main and follow.

  • public static void main(){// follow the flow}

Now if its very big I would recommend that you commit and push then if you are using eclipse do this.

Right click above the class -> find references in project|workspace.

This will find everywhere you your code is being called.

Hope it helps.

Sherlocker
  • 185
  • 1
  • 1
  • 12
  • I am using IntelliJ and I have right-clicked on the folder of all classes -> **Find in Path...** I've searched for `public static void main` and nothing comes up. – Tiffany Dec 13 '18 at 11:11
  • Do not search for public static void main but search for the class that you made. – Sherlocker Dec 13 '18 at 11:38
0

In the IDE create debug mode using Edit configuration as Application and search for the main class where you will get displayed with files where the application starts