I worked it out myself the second time I broke it: don't panic! Don't uninstall or update Java. Just change the default program for opening Java applications back to java itself.
Steps to take:
- right click on a Java app or a shortcut to a java app;
- go to "properties";
- go to the "general" tab of the properties window;
- where it says "opens with" click change.
For me there was an option of "Java (TM) platform SE binaries". I switched to that, and now all my Java apps seem to open with Java.