简体   繁体   中英

How to link classes to project in eclipse

I just extracted some classes from a jar file using a program JD GUI. Everything is great when i open the classes manually in eclipse but i would like the classes already in the project to open declarations of the classes i extracted. For now i get 'Source not found' as project is linked to the jar file.

You have a few options. For the first two, your sources will need to be in a ZIP or JAR file. I believe JD GUI has an option to export all sources to a ZIP.

  1. When you try to open a class that doesn't have a source attachment, there should be an 'Attach Source...' button that you can click on and attach the source.

  2. You can find the jar you want to attach sources to in the Project/Package explorer, right-click on it, and select 'Properties'. That will bring up a property dialog - select the 'Java Source Attachment' on the left-hand menu and then attach the source there.

  3. Perhaps the easiest - since you are using sources generated by JD GUI, why not just use the Eclipse plugin from the same author? I've used it, and it works quite well: http://java.decompiler.free.fr/?q=jdeclipse .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM