Reputation: 2534
How can Eclipse be made to open the console automatically when a program is run? I can't seem to find the preference for it.
Ideally, the result would be similar to the console behaviour in NetBeans, where the console will open up automatically when a program is run.
How can this be achieved?
the settings under console
only shows these options:
Edit: Suggestion from Comment The option to open the console seems to be excluded, why?
Upvotes: 4
Views: 6308
Reputation: 1682
Go to Windows→Run/Debug→Console and select both Show when program writes to standard out and Show when program writes to standard error
Then it will pop open the Console window regardless of whether you are in the Java or Debug perspective.
Upvotes: 1
Reputation: 11
Upvotes: -1
Reputation: 811
Go to Preferences>Run/Debug>Perspectives and select Java Application
. Then, go to the right side and change the run perspective to Java
, or make your own perspective that includes the console window. Double check that "Open the associated perspective when launching" is set to "Always", or "prompt". I tested the settings below by running while in the debug perspective; it switched to the Java perspective automatically.
The console is a view; a smaller part of any perspective. Because the Java perspective includes the console view, conveniently placed below your code, using the Java perspective and setting it to launch automatically will solve your problem.
Upvotes: 2
Reputation: 204
Assuming there is something being output to the console, Eclipse will open the Console automatically on running the program. Try a simple test:
public static void main(String[] args) {
System.out.println("I'm in the console!");
}
Upvotes: 0