Question: `/System/Library/Framework/JavaVM.framework` and `/System/Library/Java` have been deleted from my disk. I thought of making things back to normal by running the last Apple Java update ([Java for OS X Lion 2012-003 as of this writing](http://support.apple.com/kb/DL1515)) but unfortunately I'm facing the following error message:

```
A newer version of this package is already installed.

```

I still have java from oracle but I'd like to have the official one as well.

Any idea how I could get over this error message and proceed the install?

Answer: 
You can't close the application by clicking on the red button, as you said it is meant to close the window...

Using cmd-q is not a bypass but the shortcut to close the application. And the windows are not instances of the application, they are in the same instance...

What bothers you is the "resume" functionality that restores the state of an application -- e.g. all open windows -- when you restart it.

Look [here](http://osxdaily.com/2011/07/17/delete-specific-application-saved-states-from-mac-os-x-10-7-lion-resume/) or [here](http://osxdaily.com/2011/07/18/disable-mac-os-x-lion-resume-window-restore/) to see how you can tune or disable this "resume" feature.
Indeed, there are some applications which will close completly when hitting the red button, while others will just close a window. I'm afraid you can't do nothing about it, as it's a developers choice.

What you can do is disable the Auto-Open, so the `Command`+`Q` shortcut will do exactly what you want.

To do so, just go to **System Preferences > General** and uncheck **"Restore windows when quitting and re-opening apps"**.