Eclipse里如果看不到Attach Source按钮应该怎么办_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > Eclipse里如果看不到Attach Source按钮应该怎么办

Eclipse里如果看不到Attach Source按钮应该怎么办

 2021/3/2 12:29:00  JerryWang_SAP  程序员俱乐部  我要评论(0)
  • 摘要:WhenIamcreatingunittestforoneofmyJavaprojectA,Itrytohavealookatthesourcecodeofthisannotation:OnceIpressCtrlandclick,Iseethismessagebelow.The“AttachSource”buttonisnotthere.HoweverItriedanotherprojectBinmylaptop,itworks:Thisisstrange
  • 标签:Eclipse

When I am creating unit test for one of my Java project A, I try to have a look at the source code of this annotation:

class="ztext-empty-paragraph" style="">?

?

Once I press Ctrl and click, I see this message below. The “Attach Source” button is not there.

?

?

However I tried another project B in my laptop, it works:

?

?

This is strange. Then I compare the build path of two projects and find the reason. For project A, it uses Eclipse embedded JUnit:

?

?

While for project B, the JUnit managed by Maven is used.

?

?

So the easiest approach for project A is to also switch to the external JUnit instead of Eclipse embedded one, so that developers have full control on both binary code and source code.

?

?

In Eclipse installation folder there is a folder plugin, within it there is an about.html,

?

?

the binary file and source code could be downloaded from url mentioned.

?

?

After that, go to project A,

?

?

replace with:

?

?

Now the source code for JUnit is also available for project A:

?

?

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

发表评论
用户名: 匿名