2016-10-07 341 views
1

我在我的項目中使用spring 4.3.3.RELEASE。導入org.springframework.beans.Beanutils無法解析

按春documentation

我可以看到BeanUtils的是package org.springframework.beans.BeanUtils

現在,當我嘗試日食

引用

import org.springframework.beans.BeanUtils; 

enter image description here enter image description here

我收到錯誤

進口org.springframework.beans.Beanutils不能得到解決

但是當我改變spring 4.2.2.RELEASE它工作正常?

所以我的問題是,因爲它有4.3.3爲什麼它顯示爲錯誤。

+1

直到現在,你被問了4個問題,但沒有接受任何答案..但評論說它的工作...接受答案,這樣對別人有幫助 –

+0

檢查你的'spring-beans-XXXjar'文件classpath來驗證它是否包含'org/springframework/beans/BeanUtils.class'文件。 – Andreas

+0

@Andreas,我已附上顯示BeanUtils.class的圖像 –

回答

0

錯誤是因爲輸入錯誤。

作爲每Documentation它是BeanUtilsBeanutils;U信帽。

BeanUtils不是包在建議顯示,這是一個Abstract Class所以鍵入.ctrl+space(即org.springframework.beans.ctrl+space

使用import org.springframework.beans.BeanUtils;

而且它是從彈簧BeanUtils 1.0到現在。

+0

@tim tom是錯誤消失了? –

+0

還沒有面臨同樣的問題。 –

+0

怎麼來..檢查你的類路徑確保'Spring-beans' jar被引用 –

0

如果您正在使用eclipse和maven構建,請使用以下命令作爲mvn eclipse:eclipse。

+0

它顯示與mvn eclipse的構建成功:eclipse,但無法運行它 –

+0

你可以刪除關閉日食後的彈簧罐。再次打開日食,只有4.3.3罐 –