Java classes won't reload
I’m having an awful lot of trouble with Java classes not reloading. I edit my code. I put post() statements in the constructor. I compile the code. I edit my "mxj myClassname" box. The constructor doesn’t run. The java object doesn’t update to the new version.
If I quit max altogether, it does load the new, correct, version of the max java object.
I have done this over and over again to check that I haven’t missed a step. So, I’m completely stumped.
This is on my personal laptop, which has been working fine for a long while.
Any hints as to what might be wrong?
You’re not doing anything wrong. Once you have compiled the class you need to recreate the object in order to reload the class.
But, I am recreating the object. I go into edit mode. I edit the name by inserting a space and then deleting it again. The new class does not reload. It used to, but has stopped doing it recently.
I’m wiping Max 5.0.4 off my machine and upgrading to 5.1 to see if that fixes it. I don’t have anything important on that machine in terms of Java code, so will just wipe everything.
I can’t edit my post for some reason. Removing and reinstalling Max solved the problem.
My Java classes do not reload when recompiled. I do delete/undo but it does not help. I only have one mxj loaded for testing. If I restart MAX it loads the new version. How can this be fixed please?
I had this problem too. I found you need to send a "zap" message to the mxj object to make it reload on the next delete/undo. But for testing I just put the line:
in my constructor(s). Not sure that this is the ‘proper’ way of doing things but it works for me (on windows XP).
Thanks. I have tried the zap message before posting and thought I had no luck. Shall try in the constructor.