Question

When I click the run button, nothing happens. Eclipse Kepler doesn't tell me that there are any errors in my code, but it does tell me that my program is running. There are no errors output, no log files appear, nothing.

Even the below doesn't 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");
    }

}

On latest stable release of arch linux, using a version of eclipse installed through the official repos.

EDIT I opened a new, fresh project and everything runs fine. It appears (surprise 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 won't run.

I suppose the only thing to do is remove the source files one by one and see if any of them are the problem.

Was it helpful?

Solution

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

  1. Re-installing Eclipse
  2. Creating a new project
  3. Making new class files and copying the information across from the old class files individually.

Evidently, it was a problem with that particular working directory/project.

OTHER TIPS

Without more informations, there might be some solutions:

  • try to compile and run it by hand and see, if it's an eclipse related bug

  • Maybe you have selected the wrong console in your view? Try to switch through them

  • Maybe an previous program did not terminate and you still see this console

  • Maybe you have a strange colorscheme and you textcolor is the same as background?^^

I had the same problem: everything worked just fine, close, restart Windows, run Eclipse (which loaded the last workspace with the last project open), but although there are no "errors" in the Problem window, nothing runs when I do Alt+Shift+X, J (shortcut for Run Java Program).

Introducing a syntax error in the code correctly reports the error, as well as the error going away when the syntax error is fixed. Cleaning the solution had no effect.

Dropping to the command line, Maven still compiles everything perfectly. Inspecting the Eclipse Error Log window I did find many warnings, but no errors. Finally I tried per chance the Run > Run Ctrl+F11 menu option, and then it ran the program just fine as expected. After that the console displayed output as before, and now the Alt+Shift+X, J shortcut, as well as the Alt+Shift+X, T shortcut (for running JUnit tests) started to work as before!

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top