Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
754 views
in Technique[技术] by (71.8m points)

eclipse - Java Debugging: Source not found

I am having a problem with Eclipse where I can run my program just fine, but when I try to start the debugger, I get this message

Eclipse Window showing error

The picture is a little hard to make out, but instead of getting the normal debugging window, instead it says it is throwing a ClassNotFoundException, and is trying to dislay the source for Launcher$ExtClassLoader.

The thing that really baffles me though is that I can run the code just fine, it is only when I click the debug button that I have the problem.

I have also tried debugging at the command line with JDB, and I got the same error.

So far, I have tried Reinstalling Eclipse and downloading (what I believe to be) the correct Java Development tools for Mac OS X.

I have no idea what else I can try, so any help would be greatly appreciated. Let me know if there is any other information I can provide.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Source not found might be legitimate for dynamically loaded code (e.g. Maven).

There are three workarounds known to me (after months of search):

  1. Connect to a running JVM with the debugger and you will see the code.

  2. Use Dynamic Source Lookup plugin for Eclipse from here:

    https://github.com/ifedorenko/com.ifedorenko.m2e.sourcelookup

  3. Use run-jetty-run Maven plugin

    http://code.google.com/p/run-jetty-run/

I prefer and recommend 3. It works and starts webapp much faster than jetty:run.

Unfortunately 2. didn't helped me as it has issues with Windows paths with spaces.

I have filled an enhancement request on Eclipse Bugzilla and if you agree this issue "Source not found" should vanish forever, please vote for it here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=384065


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...