37

Problem description: Decompile works fine when viewing a class (i.e. Ctrl+Shift+T), but not when stepping into code from the debugging perspective - instead the "Class File Viewer" is opened. Version Used: Eclipse Oxygen and Enhanced Class Decompiler 3.0.0

panschk
  • 3,228
  • 3
  • 24
  • 20

2 Answers2

65

This will work on oxygen and later version as well:

Click on "Window > Preferences > General > Editors > File Associations"

Change default to your for both .class association.

"*.class" : "Class Decompiler Viewer" is selected by default.

"*.class without source" : "Class Decompiler Viewer" is selected by default.

enter image description here

Sayantan Mandal
  • 1,246
  • 14
  • 20
42

This is how it should look at the beginning – at least in my case this did not allow me to decompile directly from the suspended threads view. Decompiler Viewer is default, but will still not show the decompiled class

1) Add „Java Editor“ (Probably any other would do as well) at make it default. Of course this does not work, but the idea is to trigger a config change again Setting (nonsense) "Java Editor" to trigger the change of editor to be registered

2) Set Class Decompiler viewer as Default again – now it should be possible to view the decompiled class directly from suspended threads.

pdem
  • 3,880
  • 1
  • 24
  • 38
panschk
  • 3,228
  • 3
  • 24
  • 20
  • 25
    This did not EXACTLY work for me. Instead, I had to do the same thing under the "class without source" file type. – matt forsythe Feb 27 '18 at 18:44
  • 1
    The method of @matt forsythe above worked perfectly for me in Photon. – Dimitar Ivanov Aug 21 '18 at 10:35
  • 1
    I did this and still get "source not found" while debugging, I had to click on "Edit Source Lookup Path" (or go to debug configuration>sources) and then "Restore defaults". Now it works as expected. – Ould Abba Apr 18 '19 at 16:27