Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Eclipse "Searching for main types" when I just told it what to run?

Tags:

eclipse

In response to Right-click -> Run As -> Java Application,

Eclipse occasionally pauses to search for all the main types in the workspace. Why is the necessary, since I just told it what type to run? Is there a way to suppress it? (In a workspace with many open projects it's very time-consuming.)

This is with Mars 4.5.2

thanks, Jon

like image 604
Jonathan Ross Avatar asked Oct 17 '25 18:10

Jonathan Ross


2 Answers

Set up a run configuration and define which main type to run. This tells eclipse which main class to run when you run that particular config and it doesn't look for any other main type.

like image 124
justcurious Avatar answered Oct 20 '25 18:10

justcurious


I found the same problem, Eclipsed stuck on

Searching for main types...

and specifically on

Locating Java matches...

I have not be able to solve the problem cleaning workspace or reinstalling (downloading) a new version of Eclipse. I am using:

Eclipse IDE for Java Developers    
Version: 2019-03 (4.11.0)
Build id: 20190314-1200

Finally, the solution, I identificate the problem in a class that I wrote in a project, this problem occurs only when min a class I have the following import:

import java.util.stream.Stream;

Deleted that line the problem disappear.

like image 25
DAme Avatar answered Oct 20 '25 19:10

DAme