加载外部类
来源:互联网 发布:增强for循环遍历数组 编辑:程序博客网 时间:2024/05/17 07:37
public static void loadClassOuter() throws Exception {
// 外部类路径
File file = new File("D://Workspaces//MyEclipse 8.6//workone//Root//WEB-INF//classes");
try {
// Convert File to a URL
URL url = file.toURL();
URL[] urls = new URL[] { url };
// Create a new class loader with the directory
ClassLoader cl = new URLClassLoader(urls);
// Load in the class; MyClass.class should be located in
// the directory file:/c:/myclasses/com/mycompany
Class cls = cl.loadClass("com.sohu.Node");
Field[] fields = cls.getDeclaredFields();
for (Field f : fields) {
System.out.println(f.getName());
}
} catch (MalformedURLException e) {
} catch (ClassNotFoundException e) {
}
}
- 加载外部类
- laravel加载外部类
- android动态加载外部类
- 加载外部的swf
- flash加载外部图片
- 加载外部图片
- 加载外部XML文档
- 外部加载图片自适应
- flaash外部加载FLV
- 加载外部xml
- 动态加载外部脚本
- as3 加载外部XML
- as2 加载外部图片
- 加载外部图片
- 加载外部模块
- Unity3D加载外部资源
- www外部加载
- JAVA加载外部资源库
- OpenGL中文本的显示
- js 多次onload
- 汇编级代码优化
- GDB调试技术
- 真正的较量一次
- 加载外部类
- 一个用渐变色填充矩形的函数
- ORACLE随机取记录
- 开播
- 嵌入式GPS导航系统开发经验
- 一个意外把tomcat 当代理服务器用
- ORACLE日期计算
- 很经典 微小说
- oracle job执行说明