为何运行会报错呢?张老师运行的时候没事的呀,我把所有的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)
|