在eclipse下运行,报错
java.lang.NoClassDefFoundError: Java/Test
Exception in thread "main"
以下为转载的
http://blog.163.com/olfzpp@126/blog/static/19766968201031252128351/
“在重装机器后,原来的许多java工程在重新被新安装的Eclipse读取过程中出现了java.lang.NoNoClassDefFoundError的问题,查看工程目录中bin路径下没有生成对应的.class文档
网上查阅了很多资料,大部分都指示classpath设置不对。但是Eclipse本身并不需要配置classpath仍然可以正确运行。
最终,在网络上找到一盏明灯,方法如下:
把properties属性里的java compiler-->building-->abort build when build path errors occur 前的勾去掉了
这样就ok 了”
150702
生成对话框构造器AlertDialog.Builder builder=new AlertDialog.Builder(getBaseContext());的时候出现Unable to add window -- token null is not for an application异常
导致报这个错是因为new AlertDialog.Builder(getBaseContext()),虽然这里的参数是AlertDialog.Builder(getBaseContext())但我们不能使用getApplicationContext()获得的Context,而必须使用Activity,因为只有一个Activity才能添加一个窗体。 所以正确的应该是:new AlertDialog.Builder(Dialogs.this);