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

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

Related

Error that runs mistakenly the previous codes when Actually want to run the current code in NetBeans

I've got problem with my NetBeans app, once I click on the run button, it runs the previous program
I coded. Like in the image, I ran the program (Which is PasswordGUI) and it indescribably ran the previous code (Which was Ourproject)
.. So, I'm stuck in here and need help
best wishes
I tried to search if my project in the app have kind of untidy which may this problem the untidiness
of my projects..

Practice at localhost contains obsolete methods, Reason: the virtual machine was unable to remove all stack frames running old code

Problem
My code runs without problem but this prompt keeps appearing. I have run into this problem a lot but I just ignored it since the code runs fine. However it's starting to get rather annoying and all the fixes I saw online did not work. I suspect this has something to do with 'hot code replace'.
I also did set "Build automatically".
I saw on some other post that I could disable hot code replace by going to Preferences>Run/Debug, but I found no such option.
Any help is appreciated, thanks!
Apparently I was running in debug, I confused my shortcut keys... Problem fixed lol

Is it possible to use/open a GUI in Eclipse Che?

I'm recently working with Eclipse Che and have the task to import a Java Project that opens a GUI in it (like a simple Swing/SWT Calculator).
I am using the Java CentOS Stack, importing the .jar files, etc. is no problem but I get the "No X11 DISPLAY variable was set, but this program performed an operation which requires it." error.
Obviously, I found many threads about that Error, but I just wanted to ask if it is even possible to open a GUI in a web based IDE like Eclipse Che before wasting hours trying to fix that error when it's not even possible.
Maybe some of you already tried that and have a solution/tip or smth for me.
edit: found a video that answered my question. https://www.youtube.com/watch?v=AjgSp0dkxxU
Thanks anyway.
This will help you out - https://eclipse-che.readme.io/docs/che-and-swing
You need to use the right stack
You need to set the display variable. The way I did this was modify the run command to set it just before the other commands.
The command I used is:
export DISPLAY=:0.0
Also note that this worked for a while for me but randomly stop working a few days back so please tell if you manage to get it working.

JavaFX program won't run though the code is correct?

So I've been following an oracle tutorial on JavaFX and I copied the code EXACTLY. I even went as far as to copy paste it from the text version into my IDE. I'm 100% sure that the code is correct.
The first one I followed was this video series.
The second tutorial I used to ensure that there were no errors in the code and the text version I copied.
In my frustration I decided to go from my desktop to my laptop to work, so I uploaded the faulty code to my online repository and lo and behold! It suddenly worked! Which indicates that I am right about there being no errors in the code. But as soon as I make any changes, it stops working again.
The error messages I receive indicates that it happens inside of the Application I'm extending in my Start.class where I have the main().
I'm using NetBeans as my IDE, and my project is a Maven project.
The answer seems to be that you need to clean the project when you perform changes to the FX parts. Clean before you run it and it will work fine, provided there actually isn't anything wrong with your code.

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