Java Real-time debugging (gaming) - java

In this video :http://www.youtube.com/watch?v=BES9EKK4Aw4
Notch (minecraft's creator) is doing what he refers to as 'real-time debugging'. He's actually modifying the code and plays with the game at the same time without recompiling everytime.
Does anyone know what this is called or where I could get more information on how to achieve this? I've been looking around without any success!
Regards,
Erwald

This feature is called "hotswapping" and is supported by certain JVMs. The Eclipse IDE debugger is capable of hot-swapping your code in the debug (F11) mode. Eclipse can also auto-build your project once you save a modified file (AND hot-swap when running a debug build). Notch seems to be using exactly this technique.

some IDE s are doing this ie: eclipse, netbeans, intellij idea etc.
however some changes requires recompiling (method addition or deletion etc.)
and what he using is probably eclipse.

Related

Eclipse Oxygen: How to automatically upload php files on remote server

I'm coming from NetBeans and evaluating others and more flexible IDEs supporting more languages (i.e. Python) than just php and related.
I kept an eye on Eclipse that seems to be the best choice; at the time I was not able to find an easy solution to keep the original project on my machine and automatically send / syncronize the files on the remove server via sftp.
All solutions seems to be outdated or stupid (like mounting a smb partition or manually send the file via an ftp client!
I'm not going to believe that an IDE like Eclipse doesn't have a smart solution of what I consider a basic feature of an IDE, so I think I missed something... On Eclipse forums I've seen the same question asked lots of time but without any answer!
Some suggestions about is strongly apreciated otherwise I think the only solution is stick on one IDE each language I use that seem to be incredible on 2018.
I'm developing on MacOS and the most interesting solution (kDevelop) fails on building with MacPorts.
Thank you very much.
RSE is a very poor solution, as you noted it's a one-shot sync and is useless if you want to develop locally and only deploy occasionally. For many years I used the Aptana Studio suite of plugins which included excellent upload/sync tools for individual files or whole projects, let you diff everything against a remote file structure over SFTP when you wanted and exclude whatever you wanted.
Unfortunately, Aptana is no longer supported and causes some major problems in Eclipse Neon and later. Specifically, its editors are completely broken, and they override the native Eclipse editors, opening new windows that are blank with no title. However, it is still by far the best solution for casual SFTP deployment...there is literally nothing else even close. With some work it is possible to install Aptana and get use of its publishing tools while preventing it from destroying the rest of your workspace.
Install Aptana from the marketplace.
Go to Window > Preferences > Install/Update, then click "Uninstall or update".
Uninstall everything to do with Aptana except for Aptana Studio 3 Core and the Aptana SecureFTP Library inside that.
This gets rid of most, but not all of Aptana's editors, and the worst one is the HTML editor which creates a second HTML content type in Eclipse that cannot be removed and causes all kinds of chaos. But there is a workaround.
Exit Eclipse. Go into the eclipse/plugins/ directory and remove all plugins beginning with com.aptana.editor.* EXCEPT FOR THE FOLLOWING which seem to be required:
com.aptana.editor.common.override_1.0.0.1351531287.jar
com.aptana.editor.common_3.0.3.1400201987.jar
com.aptana.editor.diff_3.0.0.1365788962.jar
com.aptana.editor.dtd_3.0.0.1354746625.jar
com.aptana.editor.epl_3.0.0.1398883419.jar
com.aptana.editor.erb_3.0.3.1380237252.jar
com.aptana.editor.findbar_3.0.0.jar
com.aptana.editor.idl_3.0.0.1365788962.jar
com.aptana.editor.text_3.0.0.1339173764.jar
Go back into Eclipse. Right-clicking a project folder should now expose a 'Publish' option that lets you run Aptana's deployment wizard and sync to a remote filesystem over SFTP.
Hope this helps...took me hours of trial and error, but finally everything works. For the record I am using Neon, not Oxygen, so I can't say definitively whether it will work in later versions.

How to debug Java code in IDE (Eclipse, Spring Tool Suite) like Visual Studio?

First of all, I know my question is not a good question, I should say sorry for my this question, but this question confused me for a long time.
.Net/Visual Studio: I am coming from a .Net background. When I develop a project, I and my team are using the Visual Studio. When I debug the server side code (C# class code), it is very convenient since I use Visual Studio. I set the breakpoint, then I hover my mouse above the code, I can see what is the value of a variable or array values of a variable, so I can quickly know what is the value of a variable.
Java/Eclipse/Spring Tool Suite: When I was a student, all my courses are using Java with Eclipse, including course assignment and projects, and I found it was not convenient for debugging. Because I need to go to a debug mode, then I need to see a separate Windows within Eclipse, which shows the value of a variable in each row, this is not very efficient way to debug compared to debug in Visual Studio.
Now, I am going to develop the project using Java. This project is based on Spring framework. Then I found many people are using Spring Tool Suite, so I am going to use this IDE to develop my project.
My question is: Can we debug Java in an IDE like we debug in Visual Studio? What about debug code in Spring framework using Spring Tool Suite? Thanks.
Update:
All right, . I am testing this easy java program in Eclipse. I set the breakpoint, then I click "Run" -> "Debug", then I open a debug perspective. In the past, I only can see what is the value for variable a and b in Red Circle 2, but now, look like recently, when I put my mouse on variable a and b in Red Circle 1, I can see its value immediately? If yes, when this feature added to Eclipse? I am quite sure we cannot do so in Eclipse in the past.
Once you are actually debugging an application, you can hover over a variable in an open editor for the selected stack frame in the Debug view and see the variable's value. This is a long available feature.
You can also drag a view, using its title bar, out of the main window to create a new window if you want. I don't think this is heavily used, and may not work correctly with multiple screens, but it's there.
You're drawing a line based on IDE settings. Most likely, you're running in debug mode in VS even though you don't explicitly say it. That being said, your question is basic; of course, you can debug Java like C#.
Yes, of course, you can debug java code in Eclipse. Set a break point to the line you want to debug and select an object/variable/whichever and inspect it or add to watch.

Testing/Changing java sources at runtime

On that video: Coding with Notch we can see how Notch makes changes to Minecraft code and can immediately see the changes in game. I think that is very efficient and I would like to know how he does that!
Three Things
He is using the same workstation, He is just extending his screen.
Debug mode in Eclipse with breakpoints in those functions that are
most likely to be called in every actions in the game.
Eclipse emulators to run jar files. Similar to apk emulators

How to dynamically reload GUI in eclipse kepler?

I am building GUI in eclipse kepler and to reload changes on classes I need every time to terminate VM and start it again by Ctrl+F11.
Maybe there is a way to reload classes dynamically in eclipse. Something like jrebel but on desktop.
Thank you!
If you are using a recent JRE, Eclipse will do so called "hot code replacement" and modify the class files on the fly. That works only for certain kinds of changes. It's also explained in the Eclipse wiki (but at the time of writing the page was not accessible).

How to debug JavaFX

I've just started working with javafx, it seems cool and NetBeans seems much more fun than Eclipse but I find it impossible to debug my application. I've added breakpoints, and I pressed the debug button, I see the debugger is registered to some port but it doesn't cause the application to start.
When I run the application and attach a debugger nothing seems to happen. This is extremely annoying since I am using an external library I've added to my project, and I can't edit its content (since I am getting 'java file cannot be locked as it is read only').
I am very new to java and especially javafx, thank you for your help I sure need it:)
First off, I'd start with downloading the latest version of NetBeans (6.7.1 as of today). Second, NetBeans will let you put breakpoints in places that don't make sense for the language. You're best off putting breakpoints in a function like the run() function and stepping from there.
One more thing: make sure you have your JavaFX project set as the main project if you use that Debug button since I believe that it acts on your main project only.

Categories

Resources