简体   繁体   English

调试Java代码时Eclipse找不到源

[英]Eclipse can't find source when debugging java code

I am new to Java and started with Eclipse Kepler Service Release 1. I started a small project that contains two classes, each in its own file: 我是Java新手,从Eclipse Kepler Service Release 1开始。我开始了一个小项目,其中包含两个类,每个类都有自己的文件:

  • MIDI_Wrap_Test - a main (program) class MIDI_Wrap_Test-主(程序)类
  • MIDI_Wrap - another class ( MIDI_Wrap ) which is intended as a MIDI wrapper. MIDI_Wrap-另一个类( MIDI_Wrap ),旨在用作MIDI包装器。 - --

Both classes are in the same directory with file names being the same as the class name (with .java added of course). 这两个类都在同一目录中,文件名与类名相同(当然添加了.java)。 Something goes wrong and I want to debug it. 出现问题,我想调试它。 However, when control transfers from the main program to the MIDI_Wrap file/class I get the error message 'source not found'. 但是,当控件从主程序转移到MIDI_Wrap文件/类时,我收到错误消息“找不到源”。

I found out that this is a quite common error. 我发现这是一个非常常见的错误。 The question and answer that seem to mirror my problem perfectly is found here . 这里找到似乎完美地反映了我的问题的问答。 I added the project to the debug source path, noticing that the correct directories were already added but to no avail. 我将项目添加到调试源路径,注意到已经添加了正确的目录,但是没有任何作用。

I must be doing something wrong but am not able to find out what. 我一定在做错事,但无法找出原因。 Can someone help me out of this? 有人可以帮我吗?

I solved by shutting down eclipse and reopened it. 我通过关闭月食并重新打开来解决了。 This solved me, and code can be debug with source code view. 这解决了我的问题,并且可以使用源代码视图调试代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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