为什么我从Eclipse中收到“source not found”消息?

时间:2021-05-03 20:45:24

I'm new to Eclipse. When I debug and enter some function, I get the message "Source not found" despite the code is mine. How can I solve this issue? Is there an addon that might help?

我是Eclipse的新手。当我调试并输入一些函数时,尽管代码是我的,但我收到消息“Source not found”。我该如何解决这个问题?是否有可能有帮助的插件?

I get error class not found exception with source not found but when I press for F6 (lot)I proceed with the debugging ,the issue is just when I press F5 and want to dive in to some method code (of mine btw that just on different package)– FedorE

我找到错误类未找到异常但未找到源但是当我按下F6(很多)我继续进行调试时,问题就在于我按下F5然后想要深入研究一些方法代码(我的btw刚刚开启)不同的包) - FedorE

2 个解决方案

#1


0  

You need to add your source code in the debug configuration:

您需要在调试配置中添加源代码:

Perform the one of the steps below:

执行以下步骤之一:

Option1:

 Right Click(Java Source) -> Debug As -> Java Applications

Option2: If option1 doesn't help:

选项2:如果option1没有帮助:

 Menu ->Run ->Debug Configurations..-> Java Applications ->RightClick & select New.
 In right side, 
   Enter Name
   Browse your Project and the class having `main` method
   In Classpath, add your project from workspace
 Click Debug button in the bottom

Let me know, if it doesn't help.

如果没有帮助,请告诉我。

#2


0  

That is because , while you are in debug, the debugger enters part of code which does not have attached source files.

这是因为,在调试时,调试器会输入没有附加源文件的代码部分。

what you can do is,

你能做的是,

IF you have got the source to that file :

如果您有该文件的来源:

when you see that source not found screen, there would be a Attach Source button. press that, and browse to file that should contain source for that class. and hit ok. eclipse will load the source and you would be good to go.

当您看到未找到源屏幕时,会出现“附加源”按钮。按下它,然后浏览到应包含该类源的文件。然后点击确定。 eclipse将加载源代码,你会很高兴。

Sometimes debugger on repetitive step into enters some API classes or plugins whose source you may not have, then your best bet is to repetitively press F6 till debugger exists that class

有时调试器会在重复的步骤中输入一些您可能没有源代码的API类或插件,那么您最好的选择是重复按F6直到调试器存在该类

#1


0  

You need to add your source code in the debug configuration:

您需要在调试配置中添加源代码:

Perform the one of the steps below:

执行以下步骤之一:

Option1:

 Right Click(Java Source) -> Debug As -> Java Applications

Option2: If option1 doesn't help:

选项2:如果option1没有帮助:

 Menu ->Run ->Debug Configurations..-> Java Applications ->RightClick & select New.
 In right side, 
   Enter Name
   Browse your Project and the class having `main` method
   In Classpath, add your project from workspace
 Click Debug button in the bottom

Let me know, if it doesn't help.

如果没有帮助,请告诉我。

#2


0  

That is because , while you are in debug, the debugger enters part of code which does not have attached source files.

这是因为,在调试时,调试器会输入没有附加源文件的代码部分。

what you can do is,

你能做的是,

IF you have got the source to that file :

如果您有该文件的来源:

when you see that source not found screen, there would be a Attach Source button. press that, and browse to file that should contain source for that class. and hit ok. eclipse will load the source and you would be good to go.

当您看到未找到源屏幕时,会出现“附加源”按钮。按下它,然后浏览到应包含该类源的文件。然后点击确定。 eclipse将加载源代码,你会很高兴。

Sometimes debugger on repetitive step into enters some API classes or plugins whose source you may not have, then your best bet is to repetitively press F6 till debugger exists that class

有时调试器会在重复的步骤中输入一些您可能没有源代码的API类或插件,那么您最好的选择是重复按F6直到调试器存在该类