Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360642

Summary: Allow to associate an editor to class files which have no source
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: TextAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, deepakazad, raksha.vasisht, software.asia
Version: 3.8   
Target Milestone: 3.8 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Dani Megert CLA 2011-10-12 06:18:09 EDT
3.7.

We should allow to associate an editor to class files which have no source. This will e.g. allow users to associate a disassembler to such files.
Comment 1 Dani Megert CLA 2011-10-12 06:25:02 EDT
There is now a new file type: "*.class without source" to which an "editor" can be associated on the General > Editors > File Associations preference page.

Fixed in master: 39fa1b92959624db751da16ea63e077f42d69b08
Comment 2 Adrián Córdoba CLA 2011-10-13 16:03:52 EDT
I installed Eclipse SDK Version 3.8.0 Build id: N20111012-2000.
Then, I installed "JDT Decompiler Feature" (3.4.0.v20090220) as a new software, following the instructions, and finally I restarted Eclipse.
After that, I configured the "Path to decompiler" to point to jad.exe file, and associated "*.class without source" with "Decompiled Class File Viewer" as default.
But, when I try to open a ".class" file, the Class File Editor is opened with a message: "Source not found...".

I tried with "Java Decompiler Eclipse Plug-in" (instead of JDT Decompiler Feature), but the same thing happens.
Comment 3 Dani Megert CLA 2011-10-14 02:32:59 EDT
(In reply to comment #2)
> I installed Eclipse SDK Version 3.8.0 Build id: N20111012-2000.
> Then, I installed "JDT Decompiler Feature" (3.4.0.v20090220) as a new software,
> following the instructions, and finally I restarted Eclipse.
> After that, I configured the "Path to decompiler" to point to jad.exe file, and
> associated "*.class without source" with "Decompiled Class File Viewer" as
> default.

I don't know the 'JDT Decompiler feature' in detail, but AFAIK the 'jad.exe' will only take a class file and produce a *.jad file. You need to associate an executable that opens the given file. You can e.g. try the 'DJ Java Decompiler' (http://dj.navexpress.com/).

1. Re-install the SDK to get rid of the already installed decompiler plug-in(s).
2. Install the decompiler (not as plug-in).
3. Associate "*class without source" with the decompiler (e.g. 'DJ.exe').
   NOTE: Make sure you set the editor as default (click 'Default').
Comment 4 Raksha Vasisht CLA 2011-10-25 04:20:42 EDT
Verified for 3.83 with 4.2 Build id: I20111021-1625.
Comment 5 Raksha Vasisht CLA 2011-10-25 04:22:22 EDT
(In reply to comment #4)
> Verified for 3.83 with 4.2 Build id: I20111021-1625.

Read as Juno M3