Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open *.class files with decompiler by default in Eclipse?

When opening a *.class file in Eclipse, the default Class File Viewer editor is used showing a not coder-friendly view of the class.

Having several decompilers installed on my Eclipse instance, I can "manually" use any them to open my *.class file so it shows in the Class Decompiler Viewer editor.

What I would like though is to change the default editor from Class File Viewer to Class Decompiler Viewer so when I open a *.class file (e.g. by double-clicking it in the Package Explorer view or via the Open Type... dialog) it opens directly in the right view.

At the moment *.class files are consistently opening in the Class File Viewer editor regardless of my settings. I have to go back to the Package Explorer view, right-click the *.class file and select the desired decompiler explicitely in the Open Class With option to get it open in the Class Decompiler Viewer editor.

I have set the Class Decompiler Viewer editor as the default one for *.class files, applied, restarted Eclipse even, but still all the *.class files I open are coming through the Class File Viewer by default. enter image description here

The decompiler preference also has an option to set himslef as the default editor of *.class files, but without success on my side: enter image description here

Any idea of a solution to force the default *.class file editor to something else than the Class File Viewer one? Am I missing something obvious in my settings?

like image 277
Attila Avatar asked Sep 13 '25 12:09

Attila


1 Answers

In File Associations below ".class", you will find another ".class without source". Set your decompiler as default in that. Class files should open in the decompiler now.

like image 90
reactiveself Avatar answered Sep 16 '25 04:09

reactiveself