Java files get deleted from the designer when I shutdown the client. This is always reproducible for me.
To test:
Switch to Java-perspective
Right-click the “Local” package, and create a new package “Test”
Richt-click the new package “Test” and create a new class, “Test1” and save
Shut down all clients
Restart and go back to the Java-perspective, and the file and package are gone. If the code was already loaded by the httpserver, it will stay alive until you restart the http-task, when it will disappear.
Local folder is only meant to contain Java files generated from the Xpages and Custom controls, These files get stored on the disk (and not inside NSF). It is recommended to create a new Java source folder either under the or under “/webContent/web-inf” and then create the custom java files under it.