How to make eclipse output to console window AND a file? - eclipse

I think the question title says it all
I want eclipse to write to the console debug window and also to a file.
How can I do that? (working on a mac)

In the run configuration (Run > Run Configurations...), in the tab Common enable and set Output File.

Related

How to run system shell/terminal inside Eclipse?

I am using Eclipse Neon, and I would like to execute system commands on a shell/terminal, inside Eclipse.
In particular, I will need to open the system shell using the path of the current project folder on which I'm working in Eclipse.
In some Eclipse packages, like STS or Eclipse for JEE Developers, the Terminal is already installed in your IDE. If not, you can install the TM Terminal from the Eclipse */release update site, as you can see in the image below.
To open the command prompt (shell or terminal) using the path of a project directory inside Eclipse, you just need to select the folder, and press Ctrl+Alt+T, or right-click and select Show In Local Terminal > Terminal.
Then, the terminal will open in a new view inside Eclipse.
The Eclipse IDE which I am working there is no Terminal is there. So I needed to add the plug in like this and it works fine when you try clicking Alt+Ctrl+T
Click on Help in Eclipse-->Eclipse Marketplace--> in Find box (Search terminal and Enter)--> You will see TM Terminal 4.0 Version and just install it.
You may need to restart afterwards
And finally you will be able to get the Terminal when you will type
Alt+Ctrl+T on Console.
If you don't have the TM Terminal plugin installed, you could use external run configurations.
Click on the arrow near run button with the toolbox and add a new external run configuration.
Here, you can enter the path of your program(if you want to run commands, it will be C:\Windows\System32\cmd.exe (or the path to PowerShell on windows and /bin/bash (or similar if you use another shell) on linux.
In this dialog, you can also specify running directory of the application(the current project in your case)
After that, you can save this configuration and start it using the external run configuration menu(run button with toolbox)
Click on Run Cofiguration--> arguments --> Program Arguments (write any number of String) -->click on run
Go to Window > show view > Other.
A dialog will show up, type Terminal in the search field, select Terminal and click open.
A new empty view will show up in Eclipse.
On the top right corner of the view there is a button Labeled "open a Terminal".
Click on it, a dialog will show up
click OK and there you go, you got a Terminal.

Is it possible to set which file to run by default in eclipse?

I'm writing a python project in Eclipse with the PyDev plug-in, which contains multiple files.
However I'm used to using visual studio, where it'll automatically find the main function of a project and run the program from there.
Eclipse will always run the file I am currently editing (which usually is a file containing function that are called from the main function).
Is it possible to set which file should be run then clicking run? I've looked at the launch options under Project->Properties->PyDev, but didn't find what I was looking for.
When you press the Debug or Run button (Debug on the left) Eclipse tries to intelligently determine what to launch based on your current editor.
You can change the behaviour by editing Window -> Preferences -> Run/Debug -> Launching -> Launch Operation as pictured below.
The default of launching the current editor works well for some languages, but not as well for Python when every single file is itself a valid program to run. In your case I recommend changing to Always launch the previously launched application.
You can create a custom run configuration.
Right click on your project > run as > run configurations
From here is just a matter of choosing your project type on the left hand side and filling in the required information. You can click 'Run' to use your new configuration.
To get to this configuration again, you can click the 'Run' drop down button in the eclipse tool bar and see all of your run configurations.
Hope this helps!

Launching Eclipse debug mode from terminal, Pydev

Let say I have a working Eclipse project . The debug configuration is set up correctly such that I can launch Eclipse and start debug mode with a few clicks. No other run time input is needed and a breakpoint is already added to the beginning of the program.
Instead of clicking, I want to know if there is a way that I can do this from a terminal. Basically I want to script the command. I've found the options to disable splashdown and select the workspace. The Eclipse version is Luna. Thanks.
Check the properties of the process that's in the Debug view when you start it from there. Also: http://help.eclipse.org/luna/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm

NetBeans keyboard shortcut to run a file that is currently being edited

Is there a NetBeans shortcut to run a file that is currently being edited? Or is there a way to make one?
shift-f6 will do it. ctrl-f6 will run the corresponding test for the current file if your tests follow the conventions that nb uses for tests.
Its under the run menu, and its called "run file"

How to execute or implement batch file in java project with eclipse

Is it possible to implement or extract batch file in eclipse and debug java project in debug mode. Because without batch file I can't debugging my project and can't set breakpoint.Or some another solution. How to debug my application with use .bat file to start my java project.
Is it possible to implement or extract batch file in eclipse and debug java project in debug mode.
Hmm... You can do everything you do with a batch file (assuming you're using it to start a Java program of course) from Eclipse with a Run > Run Configuration... (also available from the contextual menu after a right-click or via the top toolbar).
Because without batch file I can't debugging my project and can't set breakpoint.
Why?! I don't think this is true.
Or some another solution.
Start your class/project in debug mode using Run > Debug (reusing or creating a new Run > Debug Configuration...). Again, this is also available from the contextual menu after a right-click or via the top toolbar.
How to debug my application with use .bat file to start my java project.
To be fully exhaustive, you can run an external program from Eclipse using an Run > External Tools > External Tools Configuration.... And you could indeed use remote debugging options and connect a remote debugger from Eclipse. But honestly, I don't think you need that.
Maybe you should explain what you're trying to do more precisely.
Try remote debugging. Eclipse can attach to remote Java processes, but the Java program must be started with special keys. I don't remember them, google/help for your service.