简体   繁体   中英

How to debug an eclipse build?

Hi guys : Whats the best way to debug the "classnotfound" Error in eclipse ?

I have a standard setup .... Ant, eclipse, etc... and every once in a while, I do something to muck my build up . I've never quite come up with a system for figuring out exactly where it is that eclipse "looks" for class files --- and how to make sure that my builds work properly.

Usually, on this project, I toggle the "builders" on and off (there is a Java builder, and an Ant builder checkbox in Properties->Builders), and build from the commandline using ant a few times --- eventually, eclipse gets synced back up and sees my class files....

So in general - my real question is - what is the right way to inspect and debug a java build in eclipse ? When you click "Run As-> Junit test" ... how and where does eclipse look for / execute the classes ?

You should check your project classpath.

Usually java uses it's native classpath (Java Home and current directory). However eclipse overrides that with the project's classpath. You have to manually add any external libraries to the projects classpath.

This is a good intro to what should be done: http://www.ehow.com/how_4784820_set-classpath-eclipse.html

To debug the "classnotfound" Error in eclipse.

You can try two solutions 1) go to projects->clean -> cleanallprojects ( if error is due to the file that you developed).

2) Check the classpath of your project to make sure jar file containing class for which your are getting the "classnotfound" Error is there in your classpath.

我没有用过,但是在eclipse中有一个蚂蚁调试器http://www.ibm.com/developerworks/opensource/tutorials/os-ecl-easyant/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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