eclipse代码中使用到Launcher获取类加载器,找不到启动器类。
解决:移除系统依赖的jar包,重新导入。
只需要在project build path中先移除JRE System Library,再添加库JRE System Library,重新编译后就一切正常了。
ClassLoader appClassLoader = ClassLoader.getSystemClassLoader();
ClassLoader extClassloader = appClassLoader.getParent();
ClassLoader bootstrapLoader = extClassloader.getParent();
System.out.println("the bootstrapLoader : " + bootstrapLoader);
System.out.println("the extClassloader : " + extClassloader);
System.out.println("the appClassLoader : " + appClassLoader); System.out.println();
System.out.println("bootstrapLoader加载以下文件:"); URL[] urls = Launcher.getBootstrapClassPath().getURLs();
for (int i = ; i < urls.length; i++) {
System.out.println(urls[i]);
} System.out.println();
System.out.println("extClassloader加载以下文件:");
System.out.println(System.getProperty("java.ext.dirs")); System.out.println();
System.out.println("appClassLoader加载以下文件:");
System.out.println(System.getProperty("java.class.path"));
eclipse代码中使用到Launcher获取类加载器,找不到启动器类。的更多相关文章
- Java的类加载器都有哪些,每个类加载器都有加载那些类,什么是双亲委派模型,是做什么的?
类加载器按照层次,从顶层到底层,分为以下三种: (1)启动类加载器(Bootstrap ClassLoader) 这个类加载器负责将存放在JAVA_HOME/lib下的,或者被-Xbootclassp ...
- eclipse 代码中突然出现特殊字符
在写代码的时候,不知道点到了 eclipse 的哪个属性,代码中就出现了一些特殊字符,也不能删除. 请问,在 eclipse 中该怎么设置,才能将这些字符去掉. 如下图所示: 解决方法: 选择Wind ...
- java中定义的四种类加载器
1,Bootstrap ClassLoader 启动类加载器2,ExtClassLoader 扩展类加载器3,AppClassLoader 系统类加载器4,ClassLoader 类加 ...
- [Eclipse配置] Eclipse代码中显示空白字符(空格,TAB和回车)的方法
在代码页面点击右键进入 Preferences --> General --> Editors --> Text Editors. 在 Show whitespace charact ...
- eclipse插件开发中全局对象的获取
转自:http://blog.csdn.net/liaomin416100569/article/details/7165425 1.获取系统默认的ShellShell shell = Platfor ...
- eclipse代码中每行的开始和结尾出现多余的特殊符号
window -> preferences -> general -> editors -> text editors -> show whitespa ...
- 深入探讨 Java 类加载器
转自:http://www.ibm.com/developerworks/cn/java/j-lo-classloader/ 类加载器(class loader)是 Java™中的一个很重要的概念.类 ...
- 转载:深入探讨 Java 类加载器
转载地址 : http://www.ibm.com/developerworks/cn/java/j-lo-classloader/ 深入探讨 Java 类加载器 类加载器(class loader) ...
- 【转】深入探讨 Java 类加载器
转自:http://www.ibm.com/developerworks/cn/java/j-lo-classloader/index.html 类加载器是 Java 语言的一个创新,也是 Java ...
随机推荐
- com.opensymphony.xwork2.config.ConfigurationManager.addConfigurationProvider
一月 31, 2016 5:06:31 下午 org.apache.catalina.core.StandardContext filterStart 严重: Exception starting f ...
- 多线程的使用:只能用cmd来玩不能用idle
from multiprocessing import Process import os def pro_do(name, func): print () if __name__ == " ...
- <td> 行高多层设置的问题
在一个table中,设置了class,并且对应的样式设置了td的高度时,在其嵌套的table中的td高度不能设置大于父table的td的高度. 只有一种方法可以设置,如下: <table wid ...
- 抓包之网络分析器- Wiresshark
https://www.wireshark.org/ Wireshark(前称Ethereal)是一个网络封包分析软件.网络封包分析软件的功能是撷取网络封包,并尽可能显示出最为详细的网络封包资料.Wi ...
- ubuntu16下Elasticsearch5.1.1安装部署
本人在安装es5.1.1版本时候整理的一些过程,参照了网上部分过程:其中过程中也出现一些其它问题,出现的问题和解决方案都整理在此文中. 1Elasticsearch5.1.1安装 到ES官网https ...
- document.body和document.documentElement区别
1.document.documentElement表示文档节点树的根节点,即<html> document.body是body节点 2. 页面具有 DTD,或者说指定了 DOCTYPE ...
- Windows游戏找不到了怎么办?
大家有的时候,可能是不慎操作,或是某些新装的Windows,会发现那些经典的游戏不见了,那它们去哪了呢?是长腿跑了?还是Windows偷工减料?都不是,让巩固来教你们把他们找出来! 1.在开 ...
- KBMMW 4.6 正式版发布
喜大普奔迎新年! Merry Christmas! We are happy to announce the release of kbmMW v. 4.60.00 Professional and ...
- S3 exercise -- 文件操作&函数
编码 请说明python2 与python3中的默认编码是什么? # 答案 py2默认ASCII码,py3默认的utf8 为什么会出现中文乱码?你能列举出现乱码的情况有哪几种? # 答案 #codin ...
- js函数预编译
function fn(a){ console.log(a); var a = 123; function a(){} console.log(a); var b = function(){} con ...