Redirect Eclipse's console / ouput to a text file

I'm doing a Java project using Eclipse. Currently by default, it shows the output in the Console. Is there any way to redirect it into a text file?

At least in python, I used to do

python somefile.py >  output.txt

Solution 1:

Open Run Configurations window and add a new run configuration or edit an existing one. At the configuration tabs, go to Common tab. There you can specify a file to direct the output.

enter image description here