Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quickly determine the entry point to a large java project

Tags:

java

eclipse

I have a very large java project, and I was wondering how to quickly determine the "entry point" to this project. Where, when I run it, is first executed.

like image 955
hair Avatar asked Jun 10 '11 17:06

hair


People also ask

What is the entry point of a Java project?

Recall that the entry point is a class having a method with signature public static void main(String[] args) . The main method of the class specified in the Main-Class header is executed.

Which of the following methods is the entry point into a Java application?

In Java programs, the point from where the program starts its execution or simply the entry point of Java programs is the main() method. Hence, it is one of the most important methods of Java and having a proper understanding of it is very important.

How do I find the main method in eclipse?

To get public static void main(String[] args) line in eclipse without typing the whole line type main and press Ctrl + space then, you will get the option for the main method select it.

How do I know what my main class is?

To visually search for classes that have a compliant main() method you can use an IDE, such as Eclipse, and visually inspect your classes. Eclipse will show you all classes (compiled or not) as trees, with methods fields and so on, and will let you perform searches on them.


1 Answers

As was commented, we need to know what kind of project. A standalone app will have a main method somewhere, but there are all kinds of different java apps that don't have an explicit one, or for that matter a single entry point.

A project could have several servlets, for example, which all will be started but none is THE entry point, they all are entry points to specific functionality.

Many UI projects will also present a series of components to the user, all started by some underlying framework. Again, there is no entry point, per se, as the main() is actually embedded within the underlying framework.

like image 92
Robin Avatar answered Sep 29 '22 01:09

Robin