JAVA eclipse 编译类文件路径

可以直接百度关键词:eclipse 编译类文件路径


http://my.oschina.net/u/224202/blog/55264


http://jingyan.baidu.com/article/8275fc869f6f0c46a03cf61c.html



http://blog.csdn.net/jbgtwang/article/details/39226889


顺便说下ClassPathXmlApplicationContext的语法。

写法1)ApplicationContext context = new ClassPathXmlApplicationContext("classpath:*/Beans.xml");(带*号)


写法2)ApplicationContext context = new ClassPathXmlApplicationContext("classpath:/Beans.xml");(不带*号)


带*号的写法1会报错。不带*号的写法2正确。

Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'helloWorld' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:387)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:968)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:246)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)
at com.csair.test.TestClassPath.main(TestClassPath.java:16)

你可能感兴趣的:(java)