大家好,我不用eclipse如何导入包呢?
我是这样做的,吧解压缩的jar文件放到我java安装目录的JDK\JRE下的ext文件夹中请问?这样对不对
D:\Program Files\Java\jdk1.7.0\jre\lib\ext这是我的放到的目录,我安装的时候即安装了JDK也安装了JRE,这时候JDK1.7下还有一个独立的JRE文件夹,请问是放到哪个JRE下?下面是我的代码和截图。大家看看为什么编译报错呢?
-------------------------------------------------错误提示-----------------------------------------
E:\>javac IntrospectorTest1.java
IntrospectorTest1.java:2: 错误: 程序包org.apache.commons.beanutils不存在
import org.apache.commons.beanutils.BeanUtils;
^
IntrospectorTest1.java:3: 错误: 程序包org.apache.commons.beanutils不存在
import org.apache.commons.beanutils.PropertyUtils;
^
IntrospectorTest1.java:10: 错误: 找不到符号
System.out.println(BeanUtils.getProperty(pt1,"x"));
---------------------------------------------------------------------------------------------------
- import org.apache.commons.beanutils.BeanUtils;
- import org.apache.commons.beanutils.PropertyUtils;
- public class IntroSpectorTest1
- {
- public static void main(String args[]) throws Exception
- {
- ReflectPoint pt1=new ReflectPoint(3,5);
- System.out.println(BeanUtils.getProperty(pt1,"x"));
- BeanUtils.setProperty(pt1,"x","9");
- System.out.println(pt1.getX());
-
- BeanUtils.setProperty(pt1, "birthDay.time", "122");
- System.out.println(BeanUtils.getProperty(pt1, "birthDay.time"));
-
- PropertyUtils.setProperty(pt1, "x", 12);
- System.out.println(PropertyUtils.getProperty(pt1,"x"));
-
- }
- }
复制代码 |
|