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: 
What you need is [RedQuits](http://www.carsten-mielke.com/redquits.html). It allows to do exactly what you explained in your post.

I just arrived on Mac OS world two days ago, and I have been pretty confused about this functionality of Mac OS. Fortunately, there is a software to get around of this "issue".

It works nicely on 10.10.4.
To do so, just go to System Preferences > General and uncheck "Restore windows when quitting and re-opening apps".

This solved my problem!