Setting sublime text as default for all Java files - Ask Ubuntu


this question has answer here:

incidentally, have rstudio & r installed on laptop. don't know why when double-click on .java files, open default in rstudio.

every time have right-click , choose sublime/gedit preferred choice open these files in proper text-editor. can guide me on how set sublime default .java files(so can open them in sublime simple double-click)?

updated request: helpful if way of doing using terminal (or way without using unity interface).

my question partially different how set default program? in preferably need terminal-using way.

gui way:

  1. right-click file.
  2. go properties
  3. go "open with" tab.
  4. select program want, , click set default. (i don't have sublime, it's not in list)

enter image description here


terminal way:

cd directory containing file , do:

mimeopen -d your-source-code.java 

sample output:

please choose default application files of type text/x-java      1) notepad  (wine-extension-txt)     2) libreoffice writer  (libreoffice-writer)     3) gedit  (gedit)     4) other...  use application # 

note: credit terminal way goes ugo hed's answer here.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User