HotSwap: Loaded classes are up to date. Nothing to reload on PC not on laptop

Answered

Hi, I edited the run configuration to be able to debug my application, I've followed the same steps both on my PC and laptop, when I use the "Build Project" button and the debug is running I cannot deploy my changes on PC with the message "Loaded classes are up to date. Nothing to reload", this doesn't happen on the laptop, it works flawlessly, I use the same configurations on both computers.

I checked every setting on both, scrolled between every Registry row, reinstalled JDKs, IntelliJ (Deleting cache files), tried other projects, used other directories / names

Before the "Nothing to reload" notification I can notice a "cache" message, but I'm not able to check what it is and if it is the problem.

Is there anything that I can follow to fix this?

Best regards, Lorenzo.

1
30 comments

Enable debug logging for build.log and check build.log file for details when you Make the project. Does it notice and compile the changes?

What run/debug configuration type do you use?

If you can't find the problem, please share a sample project to reproduce it.

1

I'm looking at the build.log...

This is the run config, which is the same of the laptop

Artifact:

Compiler settings:

Debug - HotSwap settings:

0

Jar artifact is not updated automatically. You may want to enable the "Include in project build" option in the artifact configuration. If it doesn't help, try Application configuration instead and debug the classes that are not in a jar.

You also didn't enable debug logging as described in the document.

0

The changes are found (brains.jps.incremental.Builder, debug) and the artifacts is built

The "Include in project build" doesn't work, for Application configuration do you mean "JavaFX Application"? if so, it still doesn't work

 

0

Application configuration where you specify the main class and the classes are loaded from the output directory instead of a jar: https://www.jetbrains.com/help/idea/2016.3/running-applications.html

0

No, it doesn't work, still the same notification with no change

0

You will need this file: http://download.getbukkit.org/13114107/spigot-188-r01-snapshot-latestjar the artifacts goes in the "plugins" folder

IntelliJ.rar is the name of the uploaded file

0

Please share more details how to run and debug/hotswap this project. I'm not familiar with Bukkit.

0

You start the server, an eula.txt file is created, open it and write "eula=true"

start it again, several folders will be created like "world" and "plugins"

put the other .jar files ("libraries" folder in the .rar) in this folder

the artifact output should be in this folder as a jar.

type "stop" to stop the server, if you start it again and type (after the Done message) "plugins" you should see some names, now it's done

0

OK, I found https://www.spigotmc.org/wiki/creating-a-blank-spigot-plugin-in-intellijidea/.

I started the server in Debug mode and configured the artifact jar to be deployed under plugins folder, I make a change in Main.java and do Build | Make, artifact is updated automatically on build and I get the following message which confirms that the change was reloaded:

0

That's what I get on the laptop, but not on the PC
Every file was uploaded from the PC

0

When the server is running, can you manually replace or delete plugin .jar file in the plugins folder? It could be locked by the file system in which case you can't replace it without restarting the server.

It may be OS dependent since on Linux files are not locked.

0

I can replace any jar file
The jar is updated, but it's not HotSwapped because of the notification

0

Do you start the configuration in Debug mode? Are you sure the jar artifact output is set to the correct directory?

0

Sorry, I have no more ideas then. The issue cannot be reproduced, unfortunately.

Try the clean IDE installation (remove IDE folders: https://intellij-support.jetbrains.com/hc/articles/206544519) and set up the project from scratch.

1

Thank you, I hope that this will work better than the uninstaller

0

it.. it didn't work

0

Does SFHub.jar file timestamp change in the plugins folder after Build | Make?

Does the timestamp of plugins\SFHub.jar\silverfern\spigot\hub\Main.class file inside the jar change after a change in Main.java followed by Build | Make?

0

After the Cleanup, no, not anymore

Windows now locks it

0

For me both do change. Double check if artifact is indeed built and updated, try building the artifact manually. Check the output path where classes are compiled. .class file must update there.

Check build.log with debug info to see if Main.class gets compiled.

Ensure artifact is configured to build automatically on Build | Make.

Check idea.log for possible errors.

0

I've noticed a potential issue in your configuration:

Try switching back to the default option, otherwise classes get compiled into C:\ drive root.

0

if I use the first option I get this error

0

You need to specify the output path for the project, by default it's out directory under the project root directory, for some reason it's empty in your configuration, fix it here:

2

I just saw your comment, in the meantime I've used absolute paths and it's working! Thanks a lot for your help and time

1

Great, though it's weird how your project got screwed that badly.

1
Avatar
Permanently deleted user

Thank you so much Baranov!!! After three days of search and try, your last suggestion saved my other 3 days AND motivation. I have read all the posts answers etc everything... If only this solution was mentioned on only one of those posts....

Cheers!

0

Serge Baranov man I love you! I am using Ubuntu, my laptop was force shut down with my local project running and everything was messed up. HotSwap was not working and I really had no clue why. I spent like 8 hours trying to figure out what was going on, I followed your recommendation and removed IDE folders (+ the .idea folder inside the project) and issue was FINALLY resolved! Thanks a lot man!

1

In HAlex's Hot Swap settings, "Build project before reloading classes" is checked.
But I solved this problem by unchecking it.
If you've come to this page looking for a solution, give it a try.
And please tell us the result. I'm interested if my solution works in other environments as well.

0

Please sign in to leave a comment.