Q:

How to change the default editor for a file type in Mac OSx?

The default editor for java files on my Mac seems to have been set to Xcode, but I want to change it to be the basic TextEditor.  I've looked in preferences for the association, but it's not there.  How do I change the default editor?

A:

This link provides the details on how to do this, titled: [Change File Associations in Mac OS X]]1.
excerpt of details from that link

Note this will impact all of a certain file format type, meaning changing this for one PDF will impact all PDF’s, and so on.

Find the file type(s) that you want to change the application to open with
Get Info about a file that is of that file type, say a .mov
Click the ‘Open With’ arrow to expand an application list
Choose the application you want all files of this type to open with (in this example we’ll use VLC to open all .mov files)
Click “Change All” and then “Continue” when the confirmation dialog appears

                     
NOTE: Now all of the files of that type will open in the application you specified. You can do this with any file type to keep things consistent.

