How to add delays for launch configurations in Eclipse? - eclipse

I have a launch group with several launch configurations. When it is ran, all configurations are launched one after the other quickly. I'm not sure if one launch needs to "return" in some fashion in order for the next to start.
I would like to add a delay between some of the launches. Either a manual time duration: launch1, wait 2 seconds, launch2; or some way to tell the next launch that it can happen now.
Is there any way to do it in Eclipse (I'm on 4.5.2)? Maybe a plugin or an option in the launch configuration? I'm also open for a script option if someone can guide me.

In Eclipse Oxygen this options became available as a Launch Group launch configuration. Go to Run > Run Configurations..., under Launch Group add a new configuration and then add the configurations you want to launch.
It's possible to set a delay in the Post launch action:

Related

Eclipse Launch Group - How does Launch Mode work?

I am working with STS based on Eclipse
About Run Configurations
I have some Maven configurations for Main executions defined through the Maven Build section. I need execute some of them together, for this goal I am working with the Launch Group section as follows:
From above I added three configurations to run together.
When I added each one, or even if I need update/edit each one - exists the following (observe the bottom part):
From above I did do some experiments about the Post launch action options and I understand clearly how works each one. Until here all is fine.
The situation is about the Launch mode options as follows:
From above I understand run option, it is the common or simplest execution.
But I am not able to figure out - what do or how work the rest of the options:
Inherit
Profile
Database Debug (Not sure if this option/item appears because I have the Dbeaver plugin installed)
Question: therefore how Inherit, Profile and Database Debug work? (Mostly the two first). If some scenarios or situations can be shared about when to use each one, it is appreciate to have a better perspective.
BTW if I choice Profile, appears the following error message (see blue square), as follows, so not sure when would be used (it is confuse)
The launch mode must be supported by the type of the launch configuration to be able to select it without an error.
Maven launch configurations support the launch mode Run only.
For launch configurations that supports the launch mode Run and Debug (like e.g. Java Application launch configurations), also Inherit can be chosen. Inherit means the launch mode of the launch group. Use the drop-down of the Debug button in the main toolbar to launch the launch group in Debug mode or the drop-down of the Run button to launch the launch group in Run mode. Alternatively, a launch group can be executed via the menu Run > Run Configurations... respectively Run > Debug Configurations... in the Run respectively Debug mode.
Launch groups exist since Eclipse Oxygen (4.7). This short video shows them in action. Run and Debug are the basic launch modes. All others with the exception of Inherit are contributed by additional plug-ins. For example, the Profile launch mode comes with Eclipse EclEmma for Java code coverage which is built-in in all Java IDE packages.
The dialog should not offer the option to choose a not supported mode. Maybe this is because plug-ins can add additional launch modes (in your case Database Debug) or maybe because nobody has implemented it yet (Eclipse is open source and contributions like this are welcome).
I have tried to run launch groups in coverage mode but have not been able to make it work. This seems to be a limitation in Eclipse. It would be useful to run a group of unit tests in coverage mode.

Eclipse Run not asking how to run as, and opens wrong file

I'm brand new to learning Python and am using Eclipse to go through a Python course. When I first started doing exercises in Eclipse, every time I opened a file from the course examples, the first time I ran it I would click the green "run" button, and it would ask me how I wanted to launch the file (as Python Run or Python Unit Test). Somewhere along the way it stopped doing that and now if I open a file that has never been run before, when I click the green run button, it just runs a different file. I can click through the drop down menus to run as and select python module and then the run button works fine any time I use that file, but I can't figure out why it won't just run new files the way that it did when I first installed eclipse.
You probably have configured to run the last file... (PyDev asks if you want to do that in a dialog and does that for you if you confirm). Still, don't worry, this is probably for the best anyways as you can just hit F9 to run your file directly without clicking anything (and Ctrl+F11 or clicking the run should now re-run the last launch you did).
Make sure you take some minutes to read http://www.pydev.org/manual_101_run.html for tips on the best way to run Python modules from PyDev.

How to have change debugger setting in Eclipse for a launch file

His,
I have been trying to find out why starting DevMode with Debugger from Eclipse was so slow and noticed in the list of processes on my machine the following line:
/usr/lib/jvm/jdk1.6.0_14/bin/java -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:47248 ...
Apparently the application is suspended to wait until the debugger is connected which takes about 2 minutes. I would like to set "suspend=n". Does anyone know where I could set this directive. The vm section in Eclipse launch configuration is empty and if I paste the updated debugger config there is a error telling that the values are entered twice.
As I understand it, Eclipse takes this config from somewhere and inserts it automatically when I run launch configurations in debugger mode.
Thanks
You can't remove that parameter and, if you could, it wouldn't make a difference. When you connect a new browser to the GWT OOPHM instance it has to compile the entire project for use in development mode. This is what takes time, not waiting for the debugger to attach.

Whats the shortcut to Debug in PyDev using Eclipse

The shortcut key is F11 to start debugging. But issue is that I have to be on that file and then hit F11 to start debugging.
Eg.
my file to launch the application is "launch.py" and "example.py".
example.py is open in the editor whereas launch.py is not.
Now, if I hit F11 it will try to launch the application using "example.py" and terminates due to error (as expected).
So then I have to open the "launch.py" in the editor and then hit F11 to start debugging the application.
Is there any neater way to configure the debugging, so that it starts the application in single hit/key?
Edit: example.py is some other file (some module). It does not launch the application.
As this PyDev Eclipse Tutorial suggests:
After the first run, if you type Ctrl+F11, the last file ran is re-run. Or, if you type just F11, a debug session is started with your last run. Let's test this...
Note: This behavior changed in Eclipse 3.3 -- but it's generally recommended to restore it in the preferences at: window > preferences > Run/Debug > Launching and set the Launch Operation to Always launch the previously launched application.
This tutorial will always consider this as the default option.
So, did you have this option selected?
If you have launch at least once launch.py, then you can re-launch it easily.
Although this isn't strictly an answer to what was asked initially, it might help someone looking here that had the same problem as me...
I'm a Java developer mainly, so have the Java view open almost all the time. However, sometimes I want to run some python file to test something (or just create a quick python script, and run it)...
In the Java editor, if the current class has a main(String[] args) method, I run it with (and popup the dialog to ask me what exactly I'd like to run in the middle)
alt+shift+x, j
Unfortunately, that doesn't work in the Python view, and I've not found a similar solution - it just asks me if I'd like to run it as a Java app... however, as the VonC says, you can run the last run thing (provided you've set the preferences accordingly) with
ctrl+f11
and this seems work well with python run configurations too.
But... What if the last thing I ran was a Java program, but I now want to run the active .py file? Previously, to run the .py file, I'd have to go digging through the buttons on the toolbar with the mouse, and I tend to prefer keyboard shortcuts...
Solution! So, finally I come to the actual useful bit of this answer - I just discovered by accident (typing Ivan's suggested shortcut, but missing!), it appears that
f9
will run the currently active python file.
Hope that helps someone get just that little bit faster...
I use CTRL+SHIFT+F9 to relaunch the previous debug configuration in Pydev.

error issue on the debugging process

In Eclipse®, on the Run menu, click Debug Configurations or Run Configurations.
Expand the BlackBerry Simulator item.
Perform one of the following tasks:
To work with an existing launch configuration, under BlackBerry Simulator, click a launch configuration.
To work with a new launch configuration, right-click BlackBerry Simulator, and click New.
Click the Simulator tab.
Click the General tab.
Click run
i have followed all the steps above but still i am getting the error failed to connect to the remote VM.Connection time out.org.eclipse.jdi.TimeoutException
can anyboby help me in this issue
Do you see this every time you launch your test?
This thread mentions:
For the 8530 simulator just try it again.
I get that message sometimes when I am running too many apps/low memory (I do a lot)/just started Eclipse/etc.
Often if I run it a second, sometimes third time it works and continues to work after that.