This question already has an answer here:
- How do I set the default program? 12 answers
Incidentally, I have RStudio & R installed on my laptop. So I don't know why but when I double-click on
.java files, they open by default in RStudio.
Every time I have to right-click and choose Sublime/Gedit as preferred choice to open these files in a proper text-editor. Can someone guide me on how to set Sublime as default for
.java files(so that I can open them in Sublime with a simple double-click)?
UPDATED REQUEST: It would be much helpful if a way of doing this using terminal (or a way without using the Unity interface).
My question is partially different from How to set default program? in that I preferably need a terminal-using way.