Eclipse won't even try to compile / run when it says

When I press the start button, nothing happens. Eclipse Kepler does not tell me that there are any errors in my code, but it tells me that my program is running. No errors, no log files, nothing.

Even the following does not work:

public class Main { public Main() { // TODO Auto-generated constructor stub } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("frog"); } } 

In the latest stable release of arch linux, using the eclipse version installed through the official repositories.

EDIT I ​​opened a new, fresh project, and everything is working fine. It seems (unexpected surprise) the problem is the rest of the code in the project file, not Eclipse. However, even after several restarts of my computer, my real project will not work.

I believe that the only thing to do is delete the source files one at a time and see if there is a problem.

+4
source share
3 answers

If anyone else has this problem, I solved it by doing the following:

  • Reinstall Eclipse
  • Create a new project
  • Create new class files and copy information from old class files individually.

Obviously, this was a problem with this particular working directory / project.

+3
source

Without additional information, there may be some solutions:

  • try to compile and run it manually and see if this is an eclipse error

  • Did you choose the wrong console in your view? Try switching through them.

  • Perhaps the previous program did not end, and you still see this console.

  • Maybe you have a strange color scheme, and the textcolor matches the background? ^^

+1
source

I had the same problem: everything worked fine, closed, restarted Windows, started Eclipse (which loaded the last workspace when the last project was opened), but although there are no "errors" in the window, nothing starts when I do Alt + Shift + X, J (shortcut for starting a Java program).

The representation of a syntax error in the code correctly reports an error, as well as an error when the syntax error is fixed. Cleaning the solution had no effect.

Dropping to the command line, Maven compiles everything perfectly. Having looked at the Eclipse error log window, I found many warnings, but no errors. Finally, I tried to select Run> Run Ctrl + F11, and then he ran the program as accurately as possible. After that, the console displays the output as before, and now the shortcut Alt + Shift + X, J, as well as the shortcut Alt + Shift + X, T (for running JUnit tests) started working as before!

Now, after running a program or test, jumping to the console using Alt + Shift + Q, C works fine again. I can only conclude that for some reason the console was not initialized, but in addition to this, the code did not really execute, since the output of the file that the program generated also did not occur.

0
source

Source: https://habr.com/ru/post/1502167/


All Articles