1. Go to System Preferences => Java
  2. In General tab, click Settings.. to open Temporary File Settings
  3. Copy the path from the Location and open it in Finder
  4. Drag and drop the file to the dock