打开eclipse,点击window菜单,选择preferences,如图: 选择General->Editors->File Association,如图: 然后,再从content Types中关联一下,如图: