My eclipse neon running the exact previous snapshot of Java code - java

I am using eclipse neon 4.6.3 in ubuntu 14.04. Suddenly today I have noticed that it is compiling and running the immediate previous snapshot of the code.
For example, I had a code like this:
System.out.println("1");
After running this if I change it like this:
System.out.println("2");
It will print: 1
That means it is running the previous runned snapshot of the code. As a result I have to run every program twice to observe the output.
I have tried to open new project, delete previous projects, restart eclipse etc. Nothing worked. However, when I run python scripts in eclipse, that works fine.
Anybody has any idea?
Thanks in advance
Edit: When I go to Window > Preferences > Launch it shows this:
May be this will be helpful to find out the problem.

It is solved.
Go to Window > Preferences > Launching
Check the General option: Build (if required) before launching
Then it will be ok.
Thank you all for trying to help me.

Related

Eclipse JEE Mars.2 Inspect not working

I was previously using Jboss Dev Studio (based on an older version of Eclipse) in Windows and was able to execute selected code using the shortcut Ctrl+Shift+I (when I hit a breakpoint in debug mode). A popup would appear with the result of the execution, which was extremely helpful.
I just setup Mars.2 JavaEE (4.5.2) to start a different project and am finding that this command no longer works. Under preferences->general->keys I definitely have the same shortcut (Inspect = Ctrl+Shift+i) but when I use that command, it simply obliterates the selected code and replaces it with a space! Has anyone else encountered this?
Thanks in advance.

How to completely remove Maven?

My instructor had us all install the Maven add-on for programming in Java. Now, any time I make a new Java program, it is not recognized by Eclipse. By this I mean it redirects to another program. Also, when looking in "Run Configurations", under "Java Applications", any new programs I make don't show up there. However, all programs should show up here.
Example:
Say I have a program named "Test" that I made before installing Maven. Now say I made a program "Test2" after installing Maven. When running Test, it works fine. But when running Test2, it runs Test. Other than it showing in the directory on the left, Eclipse makes no indication that Test2 actually exists. That is my issue.
My Question:
How do I completely remove Maven from my system? I don't want to use System Restore.
What I've Tried:
I have removed the Environment Variable "M3 HOME" and removed it from the "Path" variable. The issue is still there, however.
I have a Windows 10 Lenovo Y50-70 Gaming Laptop (64 bit) with 4K resolution. I am using Eclipse Luna.
After messing around a bit, I figured out the answer.
Right click any "src" folder, and click something along the lines of "Exclude Maven Artifact" under the "Maven" option. This removed it from Eclipse, and I can now make new programs and run them again.
Hope this helps whoever has my issue!

ant build java program could not find targets

I am maintaining a java program that is not mine. I used eclipse and I could build the program with Ant. I don't know very much about Ant. Everything was installed fine on my eclipse IDE and the build worked perfect till today. I didn't change anything, so I don't know why it doesn't work anymore.
When I look at the external Tools Configurations,I see that the targets are missing. I have the message "No targets could be determined for the build file". Previously I could select some targets. Does someone know how it come that the targets disappeared?
I fixed it by switching the eclipse workspace. I went to menu File->Switch Workspace->Other, and then I have selected the same workspace I was working with. Eclipse restarted and the error wasn't there anymore.
This helped for me:
remove the build file from Ant view and add it again.

Eclipse programs not running?

I am new to java. I have just got Eclipse working (somehow) lol. well my programs are running fine until-
I save a program, close out of eclipse, and re-open the program. when I try to run it the same way that works for all the other programs, I am getting a message asking to "run with ant build". for some reason eclipse will not run any of my programs that have been closed out and re-opened, but will run new programs just fine.
does anyone know how to fix this???
thanks
EDIT- i would post an image, but I do not have at least 10 reputation.. what is happening is I go to open file => C:\Documents and Settings\xxxxxx\workspace\t\src\t (t is the program's name) and then I open it, and run it. When I run it (either F11 or the run button) it pops up a window saying "select what to run as", and the only options are 2 ant build icons. Running as ant build does not work, because this isn't an antbuild file. I created a new program just to test, (from scratch) and everything compiles and runs fine...
everything is compiling and running fine on NEW programs, but I just tried opening a program I created yesterday, and it is giving me the error mentioned above.. it was running perfectly fine yesterday. also, I have JDK installed at home, and I am getting this same exact problem.. JDK isn't the source.
EDIT- i have 10 rep now. Here's an image of what was happening before the fix
" what is happening is I go to open file.."
You don't want to open the file. You want to open the project
Click on File menu
Click on import
Click on General
Select on Existing Projects into Workspace. CLlick Next
Click Browse to search from your project
Select the Project, Click OK
Click Finish
The project should now show in your package explorer and you can then run it.
To run program JRE is enough.
If you want to build project you need JDK.
Eclipse is a Java application and it works without JDK,but it needs JDK to build a project.
Eclipse is not compiler or something like that, it's only an IDE.

Netbeans keeps on restarting

I've installed the Nokia sdk 1.1 and chose to integrate the sdk with Netbeans IDE. Afterwards I tried closing the Ide but the Ide keeps on restarting and reinstalling the plugins. What can fix be the problem? I tried restarting the computer but still no change. The Ide wont stop restarting. Thanks
I got the same problem. It happens because NetBeans does not have enough privilege to update. Kill NetBeans by Task Manager -> Right click on the shortcut -> Run as Administrator. Now when you close NetBeans, it won't restart anymore.
I had similar problem where Netbeans automatically restarts after closing it.
I found that it tries to update JUnit plugin in the starting of the program but cannot complete successfully.
Then, I run Netbeans as Administrator and the problem is solved now.
Apparently this problem is caused by failed updates. In my case, the solution was to go to Netbeans’ installation path and empty the subfolder enterprise\update\download completely. After that it started normally again, and a new attempt to install the update was then successful
This site worked for me:
http://blog.ginchen.de/en/2013/09/26/netbeans-startet-nach-dem-schliessen-sofort-neu/
For Mac OS users: You can fix this by creating an AppleScript with the following code:
do shell script "/Applications/NetBeans/NetBeans\\ 8.0.1.app/Contents/MacOS/netbeans" with administrator privileges
(adjust the path to your NetBeans installation as needed), and exporting it as an application. When you launch it, the system will ask for administrator privileges before starting NetBeans, the updater works as expected, and NetBeans stops restarting all the time...
Right click on the shortcut
go to properties
click on advanced
check the box that says "Run as Administrator"
Just start Task Manager and kill the Netbeans process. Now your Netbeans IDE will stop restarting. Now run Netbeans IDE as an administrator. Now it won't restart. Enjoy! That solution works for me. I hope it works for everyone :)
there are 2 ways:
1- You can end task the "update" from the task manager. It solves your problem for this time but you will have the same problem when you open the Netbeans again.
2- Run Netbeans as Administrator. It will give the updater to finalize the updates and it will fix the issue forever.

Categories

Resources