黑马程序员技术交流社区

标题: 为何运行会报错呢?张老师运行的时候没事的呀 [打印本页]

作者: 马晓平    时间: 2013-11-18 19:04
标题: 为何运行会报错呢?张老师运行的时候没事的呀
为何运行会报错呢?张老师运行的时候没事的呀,我把所有的jar全部倒入进去了还是报错这是为什么呢?大家帮我看看吧
public static void main(String[] args)throws Exception        {                        ReflectPoint pt1=new ReflectPoint(3,5);                                String propertyName="x";                //"x"--->"X"---->"getX"--->MethodGetx---->                                Object retVal = getProperty(pt1, propertyName);                                System.out.println(retVal);                                Object value=7;                                setProperties(pt1, propertyName, value);                                System.out.println(BeanUtils.getProperty(pt1, "x").getClass().getName());//就是这个BeanUtils报错                BeanUtils.setProperty(pt1,"x","9");//就是这个BeanUtils报错                                System.out.println(pt1.getX());                                                        }
可是我把commons-beanutils的jar 和  commons-logging的jar都倒入进来了呀为什么还报错
这是报错的异常Exception in thread "main" java.lang.Error: Unresolved compilation problems:         BeanUtils cannot be resolved        BeanUtils cannot be resolved
        at cn.itcast.day1.IntroSpectorTest.main(IntroSpectorTest.java:26)


作者: 马晓平    时间: 2013-11-18 19:09
为何运行会报错呢?张老师运行的时候没事的呀,我把所有的jar全部倒入进去了还是报错这是为什么呢?

QQ截图.png (74.83 KB, 下载次数: 31)

QQ截图.png

QQ截图2013.png (4.09 KB, 下载次数: 26)

QQ截图2013.png

QQ截图201311.png (60.41 KB, 下载次数: 24)

QQ截图201311.png





欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2