intellij idea suddenly stopped noticing changes - java

Related Questions:
Intellij IDEA doesn't detect changes
How to clean project cache in Intellij idea like Eclipse's clean?
The answers does not seem to work.
File -> Synchronize, VCS -> Refresh File Status, File -> Invalidate Cache seem to be good solutions, but they do not work at all.
Also one of the file is greyed out just yesterday. But I am seeing this problem for two weeks now.
I have rebuild the project. Still it does not work.
Please help. I am using intelliJ version.
Should I delete .IntelliJIdea13>system>log?
Please look at this link too:
https://github.com/pantsbuild/pants/issues/564
I did change the folder in which my project file exists, and created a new folder with the same name and update from the SVN
"What seems to be happening is that when you don't use the --idea-project-dir override, a new directory with the name of the project is created.
./pants goal idea ... --idea-project-name=zun123463
Generated IntelliJ project in /Users/zundel/Development/java/.pants.d/idea/idea/IdeaGen/zun123463
When you use the --idea-project-dir flag, you don't get a separate directory to hold the .iml files:
./pants goal idea ... --idea-project-name=zun123463 --idea-project-dir=squarepants/idea
Generated IntelliJ project in /Users/zundel/squarepants/idea/
I'm not sure what is the best course of action. On the one hand, the current behavior gives the user exactly what they ask for so maybe we should leave --idea-project-dir alone. On the other hand, it doesn't act the same as if you don't specify the flag and sets you up for failure. I'm going to propose a patch that tacks on --idea-project-name onto the end of --idea-project-dir.
"
is this the problem?
How do I fix it?
Please help

I had this problem last night and it was a pain. My solution was to delete the .idea folder, invalidate caches, and reimport the project. I thought the problem was related to the scala plugin, but I guess its not.

This problem can be solved by deleting logs, caches, indexes and temp files at the IntelliJIdea13/system folder

Related

Eclipse Error: Overlaps the location of other project

I am trying to create a new java project in my workspace. But i am getting the following Error:
"Overlaps the location of other project"
My current projects in:
Documents/workspace/Folder/{projects(About 10 Projects)}
If i create a new project from Eclipse, the new projects are coming under:
Documents/workspace/{New Project}
I have tried to the following steps to resolve this mentioned in other posts in stackoverflow.com:
Eclipse: Error ".. overlaps the location of another project.." when trying to create new project
But i am not able to solve this. Can anyone help please?
Ok, I fought this issue for a day and feel quite humble when I finally read all the post and figured out a good solution. This should be added to an Eclipse ten commandments... Thou shalt separate your workspace from your code and never the two shall meet. In that create the folder structure something like this:
C:\workspace\training\
C:\training\maven102-section1-initial-master\...
When you open Eclipse, point your Work space to the "c:\workspace\training" area. And for all your code, keep it in the "c:\training\maven102..." area.
My issue was having EVERYTHING ALL in the same folder, like a big old hoarder... and that does not work out either. Enjoy!

IntelliJ can't find classes in same package when compiling

As an extension to my previous question (IntelliJ can't find depencency when compiling, but can in editor.) which got solved, I now have a new issue which has sprung up.
Within the same packages, references to other classes are showing up with errors:
As you can see in the picture, there is happening at the line involving the BifCreatorController, even though that class is in the same package as the BifCreatorView.
Just like my previous question, I am failing to understand why IntellJ is spitting out those errors. This project works just fine in Eclipse, but I am looking to start moving away from eclipse.
Got same problem today. Rebuilding or restarting both didn't work for me. In the end, I tried to rename the class, problem solved! Then I rename the class to the name I want, everthing was fine!
This is because BifCreatorController is excluded from compilation (see the small "X" top-left icon near to the file name). One reason would be the file got some errors while compiling, IDEA proposed to exclude it from compilation and you had accepted.
Go to "File > Settings > Build, Execution, Deployment > Compiler > Excludes" and remove it from there.
I had the same problem, i cleared the cache and restarted but it did not solve the problem. Then i right clicked the not found class and selected Recompile and after recompilation the problem was solved.
For those who can't beat the trouble i suggest switching to maven because it's predictive:
Maven > Runner > Delegate IDE build/run actions to Maven
Another reason is the cache problem.
Go to -> File -> Invalidate Caches / Restart ...

Refactoring package name breaks entire app

I am trying to refactor my package using Eclipse
org.sheehan.activity
to
org.sheehan.stocks.activity
For some reason my project just blows up when I do this and R doesn't get regenerated. How can I refactor properly?
UPDATE:
I updated my Android Manifest to reflect the change. R still doesn't get regenerated. Even after a clean. The compiler is complaining about org.sheehan.activity.R
I resolved by:
Android Tools > Rename Package Application
If you renamed properly, all your references across your project should have gotten updated. After doing this, clean your project by going to Project > Clean. This should fix it.
Fixing missing reference to R in eclipse:
Refactor -> Rename`
Build -> Clean
Android Tools -> Fix Project Properties
select the base package of your project in the eclipse package explorer, press F2 (Rename), in the rename dialog: SELECT ALL the checkboxes.:
That should do it
The package name doesn't update in the XML files. Specifically your manifest which needs to know the base package.
For more advanced imports and refactors, literally closing the Eclipse IDE can refresh a cache that causes random errors like "End position lies outside document range" or the "what once worked now doesn't hair puller outter errors."
Signs you should close Eclipse when trying to rename things are:
When you import a project, do some refactoring (like trying to change the package name), then delete the project and try again, you will see immediate R.java errors when you didn't before
When you are importing projects that have manually generated R.java files that have custom imports like "com.ns.proj.R" and don't see the name update in Preview
The box that asks if you want to "Rename subpackages" is checked unexpectedly
the code in the "Preview>>" looks as if it's been complied before instead of black and white code with the proper names replaced
you get XML errors in the manifest activity name like this
android:name="com.ns.proj.CustomCocom.ns.proj.CustomControlse="#android:style/Theme.Light.NoTitleBar"
when it should be
android:name="com.ns.proj.CustomControls"
android:style="Theme.Light.NoTitleBar"
There are too many to name obviously, however this is as important as "keep your eye on the ball" in sports. Something that is so easy to forget, yet things like these apply to other software programs like Dreamweaver (e.g. when you use the Dreamweaver "Put" option instead of FTP dragging with FileZilla and you notice your domain isn't updating your changes online). I called Adobe when I first started as a developer 8 years ago because I knew I wasn't doing anything wrong. They said sometimes the generated files to perform the action get corrupted...in other words, IDE's have bugs too!
In general, close the IDE before you off yourself...it could save your life!
Right click in your Project, go to
Android Tools > Rename Package Application
Sometimes if Project > Clean doesn´t work, so Delete /gen and /bin folders of your project.

Error: Unable to fnd class R.java No such file or dir

I keep getting this when trying to start a new project
ERROR: Unable to open class file C:\Users\Levi\Desktop\Android\workspace\Droid1\gen\com\androidbook\droid1\R.java: No such file or directory
I tried changing preferences to alter build path to project, but it still wouldnt work,,,
Is subfolder on desktop a bad place to install Eclipse?
Clean works sometimes and should be tried. I also find that blowing away the gen directory and refreshing will cause it be to rebuilt. Try that as well.
However, sometimes even that doesn't work and I've been forced to remove the project from Eclipse and then re-import it. This, unfortunately, works for me every time if the above has not.
Good luck.
Im also getting that error, running a Project->Clean in Eclipse helps for me.
Project->Clean should certainly fix this (unless your resources won't compile for some seperate reason).
I remember that the first time I ran Eclipse (in mid 2009, can't remember if it was Galileo or Ganymede or whatever) on Windows Vista, it presented several problems that were eventually traced to Eclipse itself being in a directory whose path contained a space...
Usually, the above tips (refresh, clean) work for me. But lately I had a very persistant instance of this error, which was caused by something else:
One of the layout .xml files in res/layout contained a reference to a custom view (org.company.project1.MyView). However, I had changed the package path (org.company.project2.MyView), so the reference had become invalid.
Thus, if everything fails try browsing your layout .xml files for invalid custom element definitions.
Cheers
after spending hours trying to ultimatly discover the issue behind the Class Issue not being found, resolved,or directory not there issue....
sometimes yes the issue is due to a bad binary or xml... as sometime a clean will do the trick or a xml edit will solve the day.. when all else fails.... this may do it..
"create a new workspace"
go into the workspace.... and then
Switch to your old workspace... in the newly formed workspace...
this was my silver bullet. so frustrating to not have a solid answer.
using Version: Helios Service Release 2
Build id: 20110218-0911

m2eclipse marking 'target' directory as 'Derived'

I have a Maven Java project, imported using m2eclipse.
The target/ directory is not marked as 'Derived' by m2eclipse.
Problems:
It is validated, so any validation error appear twice. My example shows a JSP Problem, when I insert intentionally an error in a jsp.
When I want to open a resource with Ctrl-Shift-R, all files appear twice, and I run the risk of editing the copy instead of the original file.
Possibly see post eclipse-ignore-folder
Note: When I set manually the directory to derived, the validation problem doesn't disappear, so that would only be part of the solution...
Question:
Is there something I need to do, so that m2eclipse sets the target/ directory to 'Derived' ?
Yeah, that has been around for a while. I wrote a plug-in that allows you to mark directories as "derived" without having to find them all (http://eclipsefrills.sourceforge.net/). It's not great, and you still have to manually run the action to make it work, but it may help.
Odd, though, I have not noticed the problem lately, myself. I wonder if there is some setting in the preferences that takes care of this now.
Good luck.
I got rid of this problem by writing a custom plug-in KeepTargetDerivedPlugin. As its name suggests, it automatically keeps all target folders derived (unlike the other solutions, which require user action).
Still, e. g. the YA2O's plug-in can be used to mark derived folders of projects which already reside in the given Eclipse workspace.
Yes: open a bug report :)
I have been so annoyed by this problem that I wrote a plugin to solve it. You can get the source and jar from here.

Categories