Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (789)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (864)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Changing values during runtime?  (Read 2737 times)
0 Members and 1 Guest are viewing this topic.
Offline purebordem

Junior Newbie

« Posted 2011-12-09 16:44:41 »

I know this seems like a silly question, I'm not that new to java, but somethings been bugging me

you see, when I watched Notch coding during the last LD competition over a livestream, it looked like he was editing values and adding whole chunks of code without needing to re-run it.

I kinda thought at first that maybe he was editing a properties file or something but when I looked closer he was actually changing things like the parameters for glColor3f or paths to textures and his applet would not restart. He would even add in more code like function calls if I remember correctly, it wouldn't close or anything, he would be in the same position he was in when he started changing code and yet textures and colors would change as he coded it. He did restart sometimes but there didn't seem to be a pattern in what he changed when he restarted and when he didn't, though I can't remember clearly.

From what I could tell I thought he was using eclipse, I can't really remember now since it was quite a while ago, but I'm wondering if there was maybe some sort of special compiler or something that did this? I've searched the internet several times but to no avail....
Offline xsvenson
« Reply #1 - Posted 2011-12-09 16:51:53 »

This has been asked before and also answered around these boards. If You search around these boards You will find. You may want to use "hot swapping" as keywords.

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #2 - Posted 2011-12-09 17:11:20 »

If you use Eclipse it's built in, it's triggered when you save a source file when the program is being run under the debugger.

It's under Preferences->Java->Debug, but IIRC it's on by default.

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie

JGO Kernel

Medals: 202

« Reply #3 - Posted 2011-12-09 17:47:24 »

Just to clear it up, hot swapping is a Java feature, supported by every IDE, not just Eclipse.  There's limits to what you can do with it, but any good IDE will tell you if your change isn't hotswappable and requires a restart instead.

Offline purebordem

Junior Newbie

« Reply #4 - Posted 2011-12-10 14:22:13 »

Thanks, I never heard the term hotswapping before, so I guess thats why I never found it Tongue
Offline philfrei
« Reply #5 - Posted 2011-12-11 06:33:48 »

And I will wait 24 hours before I "appreciate" sproingie, too, due to the recently acquired knowledge that appreciations close together in time are not worth as much as isolated appreciates.

Really nice to know this, about hot-swapping! Am looking forward to giving it a try.

music and music apps:
Offline cylab

JGO Kernel

Medals: 195

« Reply #6 - Posted 2011-12-11 10:23:21 »

Just to clear it up, hot swapping is a Java feature, supported by every IDE, not just Eclipse.
It's called "Apply code changes" located in the Debug menu in Netbeans for example. Unfortunately it can't be configured to automatically run on save, so one keypress more Wink

Mathias - I Know What [you] Did Last Summer!
Pages: [1]
  ignore  |  Print  

hadezbladez (2611 views)
2018-11-16 13:46:03

hadezbladez (936 views)
2018-11-16 13:41:33

hadezbladez (2564 views)
2018-11-16 13:35:35

hadezbladez (504 views)
2018-11-16 13:32:03

EgonOlsen (3684 views)
2018-06-10 19:43:48

EgonOlsen (4060 views)
2018-06-10 19:43:44

EgonOlsen (2445 views)
2018-06-10 19:43:20

DesertCoockie (3251 views)
2018-05-13 18:23:11

nelsongames (3323 views)
2018-04-24 18:15:36

nelsongames (4294 views)
2018-04-24 18:14:32
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!