Restarting Java procedure in Eclipse after editing - java

Somehow I broke Eclipse's Hotswap Bug Fixing feature where editing the Java code, Eclipse resets the currently executing line and allows you to continue debugging...all without restarting the debugging session. This was working perfectly a week ago. Now when I edit and save the Java source, the debugger stays at the same line and continues running as if I didn't maky any changes.
I'm going to be embarrassed when you tell me what I'm did wrong to break this. :-( :-)
This is the question and answer here that asks my exact question. Unfortunately, the answer is obsolete or at least I can't find the answer on the page.
Eclipse :Edit the source and continue debugging

After more than three months, I discovered how to fix this!
I needed to turn on "Build Automatically" in the Project menu.
Once checked, the hot-restart began working and my debugging productivity increased dramatically.

Related

java console does not update with the changes in my source code

I am trying to set up a java project and so far everything is working as one can see in this screenshot:
However when i adjust my code, the console does not update as wel as we can see here:
I tried to check path -> build automatically and clean the project but this does not work. I also terminated the console and restarted it but this did not help as well. Anyone can help me with this problem?
Kees
The answer was actually quite easy. I assumed Eclipse automatically saves your changes when re-running the console but this was not true. Thus when i just save the file it runs perfectly fine. Can't believe I spend a hour not figuring this out.
Kees

IntelliJ project files suddenly broken

I've been working on a project in IntelliJ IDEA for about two months now. Today, when I fired up the IDE, which would usually open project straight up, IntelliJ took unusually long time to load, and when it did open the project, the main .java file displayed a long line of spaces and nothing else, instead of the code that was there before. The .iml file, the only other thing in the project, was fine. An error message was on the top:
"This document contains very long lines. Soft wraps were forcibly enabled to improve editor performance."
Trying to edit the document results in the entire program freezing and becoming unresponsive. What the hell happened? It was fine one day and then just did this, how do I get my project back and how do I prevent this?
Solved in the comments below the question; thought I might as well post a dummy answer and mark this as resolved.
EDIT: Solution written out.
Right click on file > Local History > Show History
Find any suspicious changes in the list on the left. Be especially on lookout for "External changes", as those can indicate crashes and sudden power-outs. Alternatively, look for times when you remember your computer crashed or power went out while IntelliJ was open.
Revert the changes(curved purple arrow in the upper left corner). Restart the IDE if it's going slow. Everything should work properly now.

Module not specified?

I have recently started learning android development, and I just built an app that changes color and text based on pushing buttons and gestures. It ran fine on my phone (Yay!), but then on my second run, an error occurred. When hitting the "run" button, an edit configurations window opened up:
I also noticed, that on the side where my project tree should be is this instead:
I don't think there is an issue in the code because it was running fine before, but I would be happy to post the code if needed.
Also
I dont know if this was the reason, but i'll include this anyway, I tried changing the name of my project, but it wouldn't work, but I changed it back. I included this in my question because that's literally the only thing I did before this error occured.
Thank you so much for helping out a fellow programmer, I really appreciate it. I have been looking at many other forums (for some hours) about this topic, but still couldn't trouble shoot this problem. It seems kind of odd that it was working first, and then it just randomly stopped working. I cant wait for your response!
Here is the dropdown for Module:
As you can see, that is the only option.
Are you sure you are opening the project as android gradle project ?
Try to import the program not open it

Strategies for debugging a runtime Java crash that runs correctly in NetBeans

Sorry in advance. This is a really vague question because I have no idea whatsoever what is going on. I have a Java Swing GUI desktop app that I wrote in NetBeans. While inside of NetBeans, the app works fine and passes all of the tests that I have thrown at it. I've been developing this app over the past several months, deploying it at various phases of its development.
Yesterday, I finished adding and testing some new functionality. I built the application and put it on another computer. I then went to run the program (outside of NetBeans) straight from the jar file. While in the new areas (JDialog boxes), the program crashes. Since I am not in an IDE, I have no feedback to see what is wrong.
The only thing that I can think of (and this is lame) is that I added some switch statements that switch on strings, which I know to new to 1.7. I was previously developing in 1.6. Otherwise, I can think of no reason that the program should work flawlessly inside the IDE, but crash outside of it.
Can anyone offer any suggestions for how I should approach this? I'm at a complete loss.
Thanks very much.
The next debugging step for you is reducing the size of your program until it doesn't crash, then seeing what change you made worked. That should either make the answer obvious or give you a good question to post on SO.
Your idea that it might have to do with switch statements tells you to try:
removing them
removing and compiling on JDK 6 and see if it works
Those are reasonable ways to reduce your program size to see if you can make it run.
I would start from collecting a crash dump data.
If you run the UI on windows you could use DrWatson
If you run the UI in Linux , By default the heap dump is created in a file called java_pidpid.hprof in the working directory of the VM. unless you specify the path yourself by adding this -XX:HeapDumpPath= option to your UI java options.

NetBeans: Behaving weirdly by the end of the "evening"

There is nothing wrong with my title,but its true.When i run my Java NetBeans in the morning, it works fine.But in evening/night (without switching off my lappy/neatbeans), there is little problem.
When i try to run any program, it won't show me the modified Output of my program.
Suppose, in my program say 'A' i have a print statement say print("hi"), and when i change this to: print("bye") and run the program, it will show me "hi" not "bye".
It will show me "bye" at the 2nd run time.
I don't know whether this question will be closed or something, but this is real.Has anyone experienced any thing like that?Is this beacuse of :
1)My lappy is on from morning till late nignt,can this cause any problem?
2)My NetBeans is opened from morning till late night (any memory problems, or something?)
Note: It works fine it the morning time, please help me to find out the bug, it really irritates alot.
UPDATE:
Using Windows 7, NB 6.5.1
You could try deleting the cache (under C:\Users\yourUserName\AppData\Local\NetBeans\Cache\YourVersionOfNetBeans and delete it's contents.
Then do a clean and build
try to, clean and build After you make any change in your code. You may have changed the auto save option.
The 2 probable causes you mentioned at last are not valid at all.

Categories

Resources