Eclipse Kepler SR2 User Operation is Waiting Even without any tasks displayed - java

"The user operation is waiting for background work to complete."
I have searched and read for many of the solutions to this problem, yet I am still experiencing issues with long blocking on Save (sometimes up to a minute) on Kepler SR2 Build id = 20140224-0627. (This is on Windows 7 with 16GB RAM). What's interesting is that the Progress menu even shows "No operations to display at this time."
Settings:
I have Build Automatically disabled.
I have Save automatically before build enabled (Although I have tried it with the option disabled as well)
I have tried starting eclipse with -clean option enabled, but to no avail.
Does anyone have an idea why it would block even with out anything showing in the Progress window, and nothing in the Modal besides "Save"? I have noticed that when this occurs the CPU usage in Task Manager for java is much higher than normal.
Wondering if there is anything I can do before resorting to getting a new workspace or fresh install of eclipse.

To diagnose such a problem, enable the display of system tasks by opening the "view menu" of the progress view (click the downward arrow symbol), click "Preferences" and toggle "Show sleeping and system operations" - or take a thread dump of the eclipse process, and look at what the worker threads are doing.

Not a full answer (and you probably moved on :p), but Eclipse does a bunch of stuff behind the scenes for many operations. Most importantly, there are many builders that can be invoked (Project Settings -> Builders). Not sure which language you are using, but with CDT for C++, there are also a bunch of parsers and syntax checkers that get invoked.
You could try disabling some of them until this problem goes away. This solved an infinite rebuild loop for me.

Related

Disable the Refreshed Selected Content Root Pop-up in IntelliJ gradle project

In IntelliJ it seems like whenever I save a file there is this annoying green pop-up notifier at the very bottom that obscures my bottom toolbar, i.e. where terminal, messages, debug usually are.
It's usually "Refreshed selected content roots" which I believe is a gradle thing. There is no obvious way to dismiss it and it just trips me up every time.
As I often make a change and then want to switch to SonarLint or Terminal or whatever and it's blocking the button.
I know obvious workarounds like moving buttons around, but I kind of don't understand what that notifier is even called to configure it or even google it.
As #CrazyCoder would know what he's talking about, I found that the alert is caused by the (hasn't been updated in years with no configurable settings) AccuRev Plugin.
You can search this PDF for "Selected Content Roots" and you'll find it:
https://supportline.microfocus.com/Documentation/books/AccuRev/Plugins/IntelliJ/2014.2/intellij-2014.2-users_guide-en.pdf
This means if I don't plan on moving files around I can logout or disable the plugin then run accurev stat -mO when I'm done. There have been plenty of other reasons to do that, so this just added to the heap.

My Eclipse Mars won't refresh

I updated to Eclipse Mars a few weeks ago and everything went well. I only have a single non-eclipse plug-in which is Subclipse.
Today I added a few (java) files, and removed a few others, from the directories of an eclipse project (note: I didn't use eclipse to do this). When I was done I refreshed the project and it gets stuck at 98% for a solid few minutes.
I was able to cancel the refresh so I tried a clean build and sure enough it reported the errors of the missing files but won't recognize the added files. I tried a fresh again and it still hangs at 98%. I've probably retried it 5 times now, and restarted eclipse several times, and every time is hangs at 98%.
Is there any kind of cache I can clear or something I can clean? Maybe something else I can try?
EDIT/UPDATE: I just opened the project in my old Luna eclipse and it refreshed fine. Note that it uses an entirely different workspace if that matters.
I had problems using subclipse too. I changed to Subversive and it worked fine.
So it turns out it wasn't hung on refresh but actually doing a refresh and the progress bar was just inaccurate.
I do refreshes often and they usually take five seconds at most. For some reason, something triggered my entire project directory to be rescanned. Since I had thousands and thousands of data files in the project directory it was spending time looking at all of these. Relocating them made the refresh snappy again.
So, no idea what triggered the full refresh, and no idea why the progress was so wrong, but it wasn't hung, just busy.

Turning off IntelliJ Auto-save

I have done a fair amount of googling about this question and most of the threads I've found are 2+ years old, so I am wondering if anything has changed, or if there is a new method to solve the issue pertaining to this topic.
As you might know when using IntelliJ (I use 14.0.2), it often autosaves files. For me, when making a change in Java or JavaScript files, its about 2 seconds before the changes are saved. There are options that one would think should have an effect on this, such as Settings > Appearance & Behavior > System Settings > Synchronization > Save files automatically if application is idle for X sec. These settings seem to have no effect for me though, and IntelliJ still autosaves, for example if I need to scroll up to remember how a method I am referencing does something.
This is really frustrating when I have auto-makes, which mess up TomCat, or watches on files via Grunt, Karma, etc when doing JS development. Is there a magic setting that they've put in recently? Has anyone figured out how to turn off auto-save, or actually delay it?
It cannot be totally disabled. It is core to the functionality of the IDE and heavily integrated into its operation, including its Open API (for plugins). Turning it off would cause problems with a lot of features.
You can disable both Save files on frame deactivation and Save files automatically if idle for x seconds settings (via File > Settings > Appearance & Behavior > System Settings):
With those settings disabled, IDEA only auto-saves on a major event such as building, running make, running a test or application, etc. <EDIT>It should also be noted that plugin authors have access to the FileDocumentManager.saveAllDocuments() method that invokes the auto-save. This is also one more reason why removing this functionality would be problematic.</EDIT> Scrolling up in a file should not be an event to trigger auto save (unless a third party plugin is doing such). I waited a good 15 minutes to verify - no auto-save. If you are seeing different behavior, I would recommend you open up a bug report (https://youtrack.jetbrains.com). You'll want to provide as much detail as possible since IDEA 14.0.2 has been out for quite some time and there are no reports of an issue with auto-save.
Note that I have the Settings > Editor > General > Editor Tab > Mark Modified tabs with asterisk turned on to verify the file is not being auto-saved. (i.e. the asterisk remains even after a long idle period and when I reactivate the IDEA frame.) Have you turned that on? It may be something else besides auto-save that is causing the other tools to see a file change. Enabling the asterisk option would help determine that.
Why you really don't need manually saving
It should also be noted, that you always have access to Local History. Local History constantly tracks (and records) all changes made to a project. And it allows you to easily revert a file, or an entire directory, back to a previous state (even unsaved ones). So any perceived loss of functionality by not being in full control of when a file is saved is made up for with this functionality. When I first started using IntelliJ IDEA in 2003, I found the auto save functional strange and felt that I lost some control as to determine when I wanted files included in a recompile. But as I used IntelliJ IDEA, I quickly (within a week or two) came to realize that this was a false feeling of control. Between local history, changelists, and the ability to shelf changes, I ultimately had a lot more control while at the same time didn't waste time trying to figure out why my recent change was not working, only to realize I forgot to save one of the files I changed. I switch from disliking the feature to absolutely loving it. I'd encourage people that see the auto save as a "limitation" or even a "deal breaker" to just try it for a while and see. It will require some changes to your personal workflow, I think in the end you will have a better workflow. I have not missed it in the past 16+ years I've been using IDEA.
EDIT
Are you launching Tomcat via an IntelliJ IDEA run/debug configuration? If so, do you have the "on frame deactivation" option in that Run/Debug configuration set to one of the "Update" options? That would cause the files to change.
You can disable the recompilation by enabling Power Save Mode.
When Power Save Mode is on, IntelliJ IDEA reduces its functionality to the one of a text editor, by not executing expensive background activities that drain laptop battery. These activities include error highlighting and on-the-fly inspections, autopopup code completion , and automatic incremental background compilation.
Alternatively, or if you think this is a bit too extreme, change the update action for your Tomcat to "Do Nothing".
I think the correct answer was given as a comment from ryanlutgen above:
The beaviour of "auto-saving" your file is not due to the auto-save options mentioned.
IJ saves all changes to your build sources to automatically build the target.
This can be turned of in:
Preferences -> Build,Execution,Deployment -> Compiler -> Make project automatically.
Note: now have to initiate the project build manually (e.g. by using an appropriate key-shortcut)
(All other "auto-save" options just fine-tune the build in auto-save behaviour.)
The bad new is: it's not possible to disable autosaving for intellij & Co. (JetBrains Webstorm and so on). I lost some work because i pressed CTRL-Z few time to take some older code, for mistake i pressed "z" and i couldn't do anymore CTRL-Y. I cannot keep the file open in other programs because it changes all the time and the other program asks me to refresh hundred times per day...
The good new: there are some workarounds. Just see the following (the references in square brakets point to the bottom of my comment):
From the official intellij support website[1]:
«Tuning the autosave behavior
The following options are available for tuning the autosave behavior (File | Settings | Appearance and Behavior | System Settings):
Save files on frame deactivation (i.e. on switching from IntelliJ IDEA to a different application)
Save files automatically if application is idle for N seconds
Note that those are optional autosave triggers, and you cannot turn off autosave completely.»
Please also check the website [2] (bottom of my comment) where you can find other workarounds and more details, as the following:
«In Settings → IDE Settings → General
uncheck "Synchronize files on frame activation" → uncheck "Save files on frame deactivation"
if you can, uncheck "Save files if application is idle for". If it's greyed out, set it to 6442450 seconds (about 74 days)...»
The last is to install eclipse and choose a dark skin for it. Nothing is perfect but...
EDIT: the option described in [2] about setting a big number it's not necessary, unless something is greyed and you cannot disable the autosaving... I need to test that.
Ah... the next problem will be to find the "save" button/command. In intelliJ Ctrl+S is "Save all" ...
[1] https://www.jetbrains.com/idea/help/saving-and-reverting-changes.html#d1542336e137
[2] https://intellij-support.jetbrains.com/hc/en-us/community/posts/207054215-Disabling-autosave
In the latest intellij or pycharm ide use the below option for disabling autosave.
File -> Settings -> Appearance & Behavior -> System Settings -> Save files when switching to a different application(Uncheck)
I stumbled upon this as well. Besides all the answers already given, there could be another cause: In my case it was due to the SonarLint plugin I've installed. That plugin does automatic analysis of each touched file and will do an auto-safe under the hood.
When I disabled certain file types (for example TypeScript/JavaScript files) for automatic analysis, finally those files weren't auto saved any more in IntelliJ.
If there are any file watchers active (Preferences>Tools>File Watchers), make sure to check their Advanced Options. Disable any Auto-save files to trigger the watcher toggles.
This option supersedes the Autosave options from Preferences>Appearance & Behaviour>System Settings.
What worked for me was unchecking the box to save files when switching to a different application or a built-in terminal. Preferences → System Settings
According to the documentation, it does not stop auto-saving all together. But it stops it from doing it all the time - which is at times annoying and unnecessary
If you are using flow, you should also disable the auto save there.
Preferences -> Languages & Frameworks -> Javascript

Eclipse Helios having performance problems Mac OS X 10.6.5

Short Story: My house was broken into MacBook Pro among stolen items. Bought a new MacBook restored from TimeMachine drive including Eclipse folder. System files could not be restored because hardware was slightly different. I did a system update and updated to 10.6.5 and Java 1.6.0_22, all the latest. I run Eclipse Helios for Java development for college assignments.
The problem I am having is that when I run Eclipse and start coding when I get to a method of any type when eclipse usually throws up an auto-complete type box underneath the current line the program hangs for a few seconds while it loads / moves through the list depending on how fast I am typing. Example:
JTextField txt = new JTextField();
txt.get....
I could type the second line out pretty quickly as I know what I am looking for but the program will hang (multicolor swirly mac icon will replace pointer). Eclipse process will spike to 100% and I will not be able to do anything until the auto-complete box finishes whatever it could possibly be doing and the suggestion moves down to "getText()" or whatever the list beginning with "get" contains.
Things I have done to correct include, re-downloading and installing eclipse into another location, creating a new workplace in that eclipse install, re-creating the projects and code files by hand (i.e. not importing anything). The problem still persist.
I am not seasoned enough in Java to abandon the helpful suggestion box, especially when I am learning new things.
Anyone else experience this problem or know a possible solution I have not tried?
This happens with me with Android development, and I have a clue as to why - documentation! If I uninstalled the documentation, meaning the completion list wouldn't show me any API documentation, the completion list was back up to normal speed. Installed it back, the completion list is slow again. This wasn't a problem in Galileo, just Helio.
I'm trying to find the best JVM settings to use with eclipse to see if I can improve things.

Rogue instance of older version of my Java app running in background?

I'm new to Java (come from C++/.NET background) and am experiencing very strange error. I am developing w/ Eclipse IDE on Windows XP on my local desktop. It seems that for some reason, an older (and of course buggier) instance of my application stays running for some very odd reason which I cannot understand.
Even when I close eclipse, this old version of my application is running in the background. So unless I reboot, when I try to test new version of the code, this 'old, rogue instance' is fighting for the resources that are used (files on a share) with the newer (hopfully less buggy) version of the code.
Has anyone experienced this? Does the JVM cache old versions of your Java application for some reason? What am I missing here? When I reboot my machine, the instance finally dies...
I was ripping my hair out trying to figure out why the new version of my code still had the same old bug until I realized this was happening... shrug
Thanks for any help!
Do you by chance either run your program multiple times, or have forgotten to close one instance of it prior to re-running it from Eclipse?
One thing, that is not very obvious when using Eclipse, is that it allows to run any number of instances of Java programs simultaneously. When you have the Console view active, you have the option to terminate the latest launch.
To switch the console to a different launch (if there are multiple running) you can select from a list, by pressing the "Display Selected Console" icon, which is the monitor icon to the top-right in the Console view.
You can also remove any and all terminated launch console outputs from the Console view, by pressing "Remove All Terminated Launches", if every launch have been terminated it should now display "No consoles to display at this time", otherwise the next-newest running launch will be brought to the top.
If this isn't the problem, and indeed Eclipse have lost track of a launch (which is quite rare, but can happen - especially if you spawn sub processes yourself), you can safely terminate any run-amock java.exe process from the Task Manager, as Eclipse runs wrapped in a Windows executable on the Windows platform.
Java applications run under "java.exe", so you can look for that in the task list. Sadly, if several Java applications are running at the same time, it's hard to tell which is which.
I'm not terribly familiar with Eclipse, but it seems like Eclipse should tell your old version to terminate when you close Eclipse. The JVM doesn't cache past versions.
Hope this helps.
I had a problem like this as well. I would try to run the program after making changes, and it would run the older version of it, and still report errors and stop on lines that I had even commented out. I tried micdah's solution, but there were no java.exe processes in Task Manager. I solved the problem by killing the Eclipse process from the Task Manager, which closed the program without saving Eclipse Workspace settings. When I relaunched, everything I had saved in the .java files launched normally.
Could be a bug in Eclipse. Could be some code in your application that's spawning a new process. Impossible to tell from over here.
If you haven't already, check out the jps tool, which is included with the regular JDK. It might make it easier to diagnose the problem.

Categories

Resources