2

This is extremely weird. Something happened to my Eclipse (Juno) and whenever I try to open a source (Java) file from withing the app, it will open the file in an external editor.

I'm clueless.

Will also happen when I'm inside the source in Eclipse and use Ctrl-o to jump to a method.

Started happening out of the blue...

3

Try to configurate next options in Windows-->Preference
And General > Editors > File Associations enter image description here

  • Thanks. The *.java type does seem to be missing. After adding it and restarting Eclipse I get an error in the Eclipse Log (org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)) Looks like a bug in Eclipse – Ben Sep 4 '12 at 7:47
  • I can advice you to re install eclipse, i think it can help – Ishikawa Yoshi Sep 4 '12 at 7:59
  • 1
    I will. I've lost all hope :-\ – Ben Sep 4 '12 at 10:27
5

Bit of an old question I know but I just had the same problem and found this page. After checking the file associations to no avail I stumbled across the solution...

It appears to be possible to assign a different editor to an individual file in Eclipse by using the "Open With..." menu. In my case I managed to do this by accidentally pressing the Context menu key and typing I S, which caused my Java file to open w_I_th the default _S_ystem editor. Eclipse then remembered this, so using Ctrl-O to navigate to a method was opening in the external editor despite the .java file remaining open in Eclipse!

Subsequently closing and reopening the reassigned .java file then only used the external editor, despite other .java files opening internally.

Right-click on the file in the Navigator (or similar) View and check the Open With menu - if it doesn't have the Default/Java editor icon highlighted this will be the fix.

  • 1
    Thanks, Moss, you've saved me a day of figuring out what went wrong! This answer should be the accepted one. What a stupid feature... – Powerslave Sep 25 '15 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.