Attach the Source in Eclipse of a jar

前端 未结 11 1643
清歌不尽
清歌不尽 2020-11-28 06:46

I added a Student.jar into my Build Path in my eclipse like this-

Right click on the project->BuildPath->Configure Build P

11条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 07:32

    Simply import the package of the required source class in your code from jar.

    You can find jar's sub packages in

    Eclipse -- YourProject --> Referenced libraries --> yourJars --> Packages --> Clases

    Like-- I was troubling with the mysql connector jar issue "the source attachment does not contain the source" by giving the path of source folder it display this statement

    The source attachment does not contain the source for the file StatementImpl.class
    

    Then I just import the package of mysql connector jar which contain the required class:

    import com.mysql.jdbc.*;
    

    Then program is working fine.

提交回复
热议问题