Before asking - I have checked similar questions and was not able to achieve my goal so far. My trouble resulted from CTRL+F2 not working in Eclipse. Therefore I spent time looking for shortcut settings and tested solutions here
What is the short cut in eclipse to terminate debugging/running?
or here
Eclipse Terminate Keyboard Shortcut
yet none of this seems to work.
By now I have discovered the reason why, so here is the question:
Why is my context menu Run > Terminate greyed out, even though a Java application is launched?
The steps I am taking are:
1) ALT+R to open Run context menu
2) N to open Run Configurations
3) ALT+R to run my configuration
4) The application launches as expected
5) Now I switch back to Eclipse and press ALT+R again - Terminate is greyed out, while the application is running.
Why is that?
Note:
This is the reason for the terminate shortcut not working properly, because this context menu entry is annotated with the according shortcut, as long as it is greyed out nothing will ever happen.
I am also in the Debug perspective.
Pressing the red rectangled Stop UI element will still kill the application, as it should. All the while the context menu entry in Run remains greyed out. Why would these two even map to different things?
Thanks in advance for any kind of insight.
This is only enabled when you have selected the application in the Debug view.
I was able to achieve what I was looking for with help of #greg-449.
The setup is now as follows:
In Eclipse open Window > Preferences > General > Keys > Show View (Debug) set a shortcut to ALT+ SHIFT + F2 as suggested in the sources I linked. Set binding to In Windows.
Now after launching it is possible to press the newly set shortcut to open debug and after that the Terminate context menu will become available, even though there is apparently no way to call Terminate all which is what the UI element does.
In conclusion, it is complicated, but at least it works. Being forced to manage launches this way still seems absurd to me, however.
Related
This is what I see in my Intellij UI IDE
The correct breakpoint is being hit(line 128 - checkRunFlag() )
but the step over/step in buttons next to console in the bottom left part of the screen are greyed out. Does anyone know what is causing this/how I can re-enable those buttons?
In my case it was greyed out until i entered a input (i.e part of program before breakpoint). After i entered the input using Scanner class, i was able to access step into and other buttons.
change to your debug application
I'm still not sure what the cause of this issue was but what I did to fix the issue was call kill -9 with the process id of Intellij
Then I restarted Intellij and it's working fine now
you can click the "pause pragram" to see where the breakpoints stopped. then make sure it's your expect application.
So there is a small java program to add two numbers.
There is one break-point.
I used Debug as -> Java Application.
But still, Step Into, Step Over, Resume, Suspend and Terminate buttons are disabled in my eclipse.
See below:
Debugger recognized the breakpoint at int b = 3 but still the buttons are disabled.
Everything was working fine yesterday.
What should be the cause?
Possibles solutions and cause here.
The commands got disabled, probably from previous customization, (check General -> Keys) but I wouldn't think this can be the only reason to be cause of this issue.
Hope this helps you out.
I have met the same issue and fixed it. The following are the possible solutions:
Make sure that your skip all break point option is disabled
Reset your debug perspective in perspective options.
Make sure to restart eclipse after doing above things
Hi i'm new to java and when I press the debug button it is not going into debug mode.
After clicking on the drop down arrow next to the icon it says 1 new configuration and when that launches it just says in the console 'OK'. If I go on debug as it just says none applicable.
If I go on debug configurations I don't really understand what I'm supposed to go on to get it into debug mode as i guess it is something to do with the configuration?
If it helps I'm trying to write code for a project, not android or anything like that. Hope this is enough information, thanks.
Did you remember to add a breakpoint somewhere? If not, add a breakpoint! You can do that by double clicking one of the line numbers in your source code.
You may also want to check the toolbar to see if you accidentally checked the "skip all breakpoints" option.
I've found several posts with instructions of how to kill java thread with jdb http://www.rhcedan.com/2010/06/22/killing-a-java-thread/ or on SO. This works.
Now I want to kill thread with Intellij-IDEA debugger. Is it possible to do?
There is a little icon on the right side of the Debug view:
This will open 'Threads' tab and there you can right-click on some of them and select 'Interrupt' (and press F9 if you are sleeping on some breakpoint).
The accepted answer is now outdated (at least it is different for me in IntelliJ 2022.3.2). Just in case anyone (like me) stumbles upon it, there is a button at the right side of the debugger that allows you to show threads (it is disabled by default).
see image below:
Then you'll be able to select the thread you want to modify through the debugger by right clicking it.
I am using Eclipse Juno in an Ubuntu environment, and about every hour my eclipse functions start to act weird. Pressing delete, Ctrl-d will stop working, or delete things in another class I have opened.
Same thing for the cut/paste and inspect functionality, it either doesn't do anything or it pastes/inspects something in a different class I have opened. I doesn't matter if I try it by using the mouse or the keyboard shortcuts.
I'm fairly sure it's an eclipse issue, as this only affects eclipse, and when I restart eclipse these issues are resolved. This is a pain in the ass though, as I have multiple servers running in eclipse, and restarting these take some time.
Refreshing my project as described here doesn't work for me.. Any ideas?
sounds like your key bindings might be being overridden by a plugin you have installed..\
Open eclipse, go to -
Window->Preferences->General->Keys
filter for Delete Line- if it is not bound to Ctrl+d then set the binding.
To check for duplicates, click the Delete Line key binding, then sort by "Binding" and see if you have one overriding it. If you do, then you have a couple options -
Disable the Ctrl+d binding that the plugin is using
Change your Delete Line binding to another. I like mine being Ctrl+L
The way keybindings work in eclipse is all dependent on the When column in the key bindings window. It should be set to Editing Text - if it's not, then you should probably set it to that. It might not be working for you in some other content type, say, if you are editing the .classpath