eclipse工程中classpath的信息

在java工程中的配置文件中,有时需要使用classpath来配置xml等:

	<!--JAR启动-->
	<import resource="classpath:META-INF/ams_web_applicationContext-server.xml"/>
	
	<!--EJB启动
	<import resource="classpath:generated/ams_common_svr_applicationContext-bean-ejbclient.xml"/>
	<import resource="classpath:generated/ams_core_applicationContext-bean-ejbclient.xml"/>
	<import resource="classpath:generated/ams_applicationContext-bean-ejbclient.xml"/>	
	<import resource="classpath:generated/acct_core_business_applicationContext-bean-ejbclient.xml"/>
	<import resource="classpath:generated/acct_common_svr_applicationContext-bean-ejbclient.xml"/>
	<import resource="classpath:generated/ams_web_applicationContext-ejb-reserved.xml"/>
	-->
	<!--依赖web包-->
	<import resource="classpath:META-INF/ams_web_applicationContext-action.xml"/>
	<import resource="classpath:META-INF/acct_common_web-business.xml"/>
	<import resource="classpath:META-INF/acct_common_web-cache.xml"/>


classpath配置在工程根目录的.classpath文件中,可以直接文本方式打开:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4">
		<attributes>
			<attribute name="owner.project.facets" value="java"/>
		</attributes>
	</classpathentry>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/aopalliance-1.0.jar"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/aspectjweaver-1.6.9.jar"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/commons-collections-3.2.1.jar"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/commons-dbcp.jar"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/commons-dbutils-1.5.jar"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/commons-dbutils-1.5-src.zip"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/commons-logging-1.1.1.jar"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/commons-pool-1.6.jar"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/jasper-compiler.jar"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/jasper-runtime.jar"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/jstl.jar"/>
	<classpathentry kind="lib" path="D:/Ailk/Jworkspace/summer/WebRoot/WEB-INF/lib/log4j.jar"/>
	<classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
</classpath>


JVM加载类时,使用classpath的策略是从前到后搜索,如果在搜索过程中,已经找到需要加载的类,那么就不再向后搜索。所以,如果在classpath中存在重复的类,那么JVM只加载classpath配置中,位置靠前的类。后面的类就不会被加载了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值