How to get Java Decompiler / JD / JD-Eclipse running in Eclipse Helios

前端 未结 14 2902
忘掉有多难
忘掉有多难 2020-12-04 11:10

Java Decompiler (JD) is generally recommended as a good, well, Java Decompiler. JD-Eclipse is the Eclipse plugin for JD.

I had problems on several different machines

14条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 11:25

    The JD-eclipse plugin 0.1.3 can only decompile .class files that are visible from the classpath/Build Path.

    If your class resides in a .jar, you may simply add this jar to the Build Path as another library. From the Package Explorer browse your new library and open the class in the Class File Editor.

    If you want to decompile any class on the file system, it has to reside in the appropriate folder hierachy, and the root folder has to be included in the build path. Here is an example:

    1. Class is foo.bar.MyClass in .../someDir/foo/bar/MyClass.class
    2. In your Eclipse project, add a folder with arbitrary name aClassDir, which links to .../someDir.
    3. Add that linked folder to the Build Path of the project.
    4. Use the Navigator View to navigate and open the .class file in the Class File Editor. (Note: Plain .class files on the file system are hidden in the Package Explorer view.)

    Note: If someDir is a subfolder of your project, you might be able to skip step 2 (link folder) and add it directly to the Build Path. But that does not work, if it is the compiler output folder of the Eclipse project.

    P.S. I wish I could just double click any .class file in any project subfolder without the need to have it in the classpath...

提交回复
热议问题