<bean id="obstacle1" class="C:launchCodeFilessrcmainjavaRunMario.java">
改为
<bean id="obstacle1" class="RunMario">
class路径为(包名+类名)
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="chineseId" class="com.jin.Chinese"> <property name ="axe" ref="stoneAxeId"></property> </bean> <bean id="stoneAxeId" class="com.jin.StoneAxe"> </bean> </beans>