since I've updated to IntelliJ 2016.3 on my mac, it seems like classes doesn't get recompiled if I restart my application. I always need to call mvn compile which I didn't need to do before the update. I didn't found anything that would explain such a behaviour. Am I missing something?
Edit:
With restart I mean rerun my app in debug mode. See the screenshot. (Needed to black out a few things due to security reasons)
Related
I installed AJDT plugin from eclipse site. Then created Aspectj project. And if I saved anything in there, it started building workspace forever. I tried to close Eclipse, but needed to force close it and now it won't even starts, just loads forever. My code in project are only few lines, so I don't get it why it should be that slow. What could be wrong? Is AspectJ that slow or what?
How could I restore Eclipse as I can't even use it now..
Update
Eclipse loaded after like 10 minutes. Then I deleted one character of code and pressed save and it all started again. That is insane. I suppose it shouldn't be like that? I unchecked 'Build automatically' option, but it sill does the same thing.
And now I just got this error:
java.lang.OutOfMemoryError
Compile error: OutOfMemoryError thrown: GC overhead limit exceeded
So it just ran out of memory. So it is something really wrong, but I don't see what could be.
Also this only happens with AspectJ project, with normal project everything runs smoothly. So maybe I should do something in AspectJ project before trying to write there, like check/uncheck something?
P.S. I also added Spring jars and commons-logging jars in that project. Maybe that has something to do with it?
When I first ran eclipsify on my Project I noticed that Eclipse complained about the:
return ok(index.render("Your new application is ready."));
Line. It did not recognize the index method. The application still ran so I ignored it for the time being. Now, however, I am getting a new error. I think I just added a few dependencies to Mongo, attached some Model files and rebuilt but I am now getting this error:
compile: sbt.InvalidComponent: Could not find required component 'compiler-interface-src'
I'm not sure why this is happening, especially because I'm a bit of a sbt idiot. As a side note, Eclipse is reporting that my "classes_managed" build path entry is missing, but I think that is due to my inability to compile after doing a clean. (Clean and update are working).
1) Templates are compiled by Play, not by eclipse. After the "eclipsify", you need to run play compile (or play run) and refresh your eclipse project. See How to make Eclipse see the changes in Play! compiled templates?
2) After adding dependencies, launch a new time the play eclipsify command.
But i think it's not the problem. What is the dependency you add ? And what is your Play2 version? (I suspect an incompatibility with a Play2.1 library)
And for your information, a general rule: Play doesn't depend on Eclipse to compile files. Do not try to clean in eclipse, but run play clean (and refresh eclipse).
Happen to run into this issue few times, tried above, also following
Clean up Play-framework based project
But nothing worked.
What it turned out to be was a IntelliJ Idea cache corruption issue, and invalidate and restart Idea worked fine.
We are using JRebel to quickly reload Java code changes into our JVM. This is working great!
But, we are also using Eclipse as IDE. And for some reason, Eclipse can really rebuild the whole project in my workspace, just because I add an annotation, I remove a method, or any other little code change ...
Because of this rebuild phase, all classes are regenerated and are required to be reloaded by JRebel.
Is there any way to debug why Eclipse is always rebuilding our project for even a stupid little code change?
I'm using Eclipse Indigo.
Thanks,
Jochen
You need to disable (or) uncheck Build Automatically.
Goto Project menu--->uncheck Build Automatically.
NOTE: This disables Automatic build. But as JesperE commented, it may impact the cause why you JRebel.
Disabling build automatically option does not break JRebel. JRebel depends on the results of the compilation, so if you disable the automatic build you will have to just compile the changed classes yourself, that's it.
You can try setting a VM argument -Drebel.check_class_hash=true which will check the checksum before reloading the classes. It may slow down the reloading time from a few milliseconds to some milliseconds extra. But it is still better than the situation when all the project classes have to be reloaded.
I know this question may seems stupid since i cannot give a lot of infos about it, but I think that the problem has to be some kind of bug...
I have written a java program whith NetBeans 7.1, which now gets me this error when trying to run. 10 mins ago it was perfectly running, and i have changed nothing to the class the error refers to
Could this be some kind of NetBeans error? Maybe it is a well know problem?
It also got this exception in NB 7.2
'clean an build' and restarting NB didn't work
updating NB with the latest updates and performing 'clean and build' also didn't work.
So i renamed the cache directory:
c:\Users\userabcd\AppData\Local\NetBeans\Cache\7.2\index\
started NB, waited for it to finish 'background scanning' and pressed 'Debug project' and voila. The cache gets corrupted every once in a while :-/
EDIT: Added Solution B below.
Solution A:
Project Properties
Build >> Compiling
un-check: Compile on Save
Clean and Build
Notes A:
If you leave Compile on Save un-checked, you won't have this problem any longer for this project.
If you enjoy the benefits of the Compile on Save feature, you can re-check the option after you clean and build, and continue work on your project as normal.
Compile on Save is meant to save time by constantly recompiling your .java files into .class files in the background as you save changes to your source code. That way when you build or run your project, most of the compiling work has already been completed allowing you to run and test your code quickly, even for large projects.
NetBeans uses some fancy caching and versioning to avoid having to recompile your entire project every time you save a file. That's why the other solutions listed here will often work; they are ways of defeating this caching-and-versioning system when it occasionally fails, as it has above.
Solution B:
Create empty folder e. g. C:\Temp\mine
Create a new shortcut for NetBeans
with command line parameter in Target:
"C:\Program Files\NetBeans 8.2\bin\netbeans64.exe" --userdir "C:\Temp\mine"
When compile errors occur
(ClassNotFoundException, MethodNotFoundException, etc...)
delete C:\Temp\mine\var\cache
Notes B:
You'll lose all your NetBeans settings the first time.
Much easier to solve future compile errors caused by caching bugs.
Allows running multiple copies of NetBeans, one per userdir.
I got also this exception. My solution was:
edit and save mentioned class (.java file)
clean & build project
deploy to tomcat server
I just had this happen to me with Netbeans 7.4 Beta.
Things I tried:
Restarting Netbeans.
Clean and build.
Shutting down netbeans, renaming the cache dir, starting netbeans and waiting for scanning to complete.
What worked for me:
Making the source file writable and saving a meaningless change (inserting a space).
I don't know why any of the other steps didn't fix the error. Maybe it would have worked if I had done a clean and build after renaming the cache dir?
Its a very frustrating situation to be in - Hopefully this helps someone (perhaps a future me?).
The JDK says for ClassFormatError:
Thrown when the Java Virtual Machine attempts to read a class file and
determines that the file is malformed or otherwise cannot be
interpreted as a class file.
Perhaps a class file has become corrupted. I am going to do the standard IT support statement.
Have you tried restarting NetBeans?
Hope that helps
Got right the same thing with Netbeans 7.1.
Working on a project that works fine for several months.
Now I changed a bean which gets persisted with javax.persistence and now this exception got thrown. Reverted my few changes, clean and compile the project, reboot the whole system: still exceptions.
The curious thing about it: the generated .war works perfectly in a Tomcat at another machine.
UPDATE:
Today I got the same problem again and I couldn't recall how to solve it, but I found this post again. ;)
After a half hour I found the solution: Just change value of the property serialVersionUID, redeploy the app and then you can change the value to its original value and redeploy again -> working.
Seems like Tomcat is holding that class somewhere deep inside – deleting working directories didn't led to success.
I'm trying to debug code that I've built from source. It is started with the wrapper from Tanuki.
I'm debugging inside IntelliJ idea but I'm not sure that is the problem.
The debugger correctly stops at all lines where I've put a break point but never else so F8, "step over" doesn't work. Very tiresome as I have to put break points every where :)
Am I doing something wrong?
How do you build the project? If you build it with Ant or some other tool, make sure that compilation is performed with debug info enabled (debug=true for Ant javac task). Obfuscation and bytecode instrumentation during the build can also affect the possibility to debug. If you run under some non-standard JVM, it may also cause such problem.
When performing remote debug, ensure the target process is started with the correct JVM options suggested in the IntelliJ IDEA Remote debug configuration. Your wrapper configuration may pass them incorrectly.
Make sure you don't have a different jar on the classpath (other than the project) with the same classes. You could be stepping through the compiled classes and "breakpointing" in the sources.
This worked for me: http://devnet.jetbrains.com/thread/267022. Basically there's another lib in the classpath confusing the debugger. Simply find out which library it is by stepping into during the debug. Then find it on the project and delete it.
In my case, it was an auto generated file that was causing the confusion.
happened to me as well, on Eclipse (Mars).
Restart of eclipse solved it... as simple as that...
I also faced the same problem.Below trick worked for me:
Delete the settings for Intellij
Windows User :C:\Users{username}.IntelliJIdea14
This will restart the Intellij for you from the beginning.
Hi I also had the same behavior and I got it fixed by installing the latest IntelliJ after removing/rename the folders found in these locations https://intellij-support.jetbrains.com/hc/articles/206544519
I had to delet all the versions I previously installed. Just give it a try.