java web項(xiàng)目一直都是好好的,后面電腦安裝過(guò)系統(tǒng)后(以之前的版本不一樣),安裝所需軟件(如myeclipse、tomcat)并進(jìn)行配置。然后在myeclipse中添加項(xiàng)目卻報(bào)錯(cuò)了
1.Archive for required library: ‘... .jar’ in project ‘xxxxxxxxx’ cannot be read or is not a valid ZIP file.
2. The project cannot be built until build path errors are resolved.
但是我查找了一下那個(gè)jar確實(shí)是存在的。在網(wǎng)上查找了許久,答案不一:jar不完整、路徑問(wèn)題等等。
解決方案:
1)刪除提示錯(cuò)誤路徑下的所有jar包(C:\Documents and Settings\Administrator.m2\repository\org...)。
2)安裝maven,詳細(xì)的安裝步驟點(diǎn)擊here,
3)開(kāi)始—運(yùn)行—cmd—進(jìn)入到web項(xiàng)目所在路徑(cd:web項(xiàng)目的路徑)
—
(a)輸入mvn compile(編譯源代碼)回車;
(b) mvn clean (清除目標(biāo)目錄中的生成結(jié)果)回車;
(c)輸入**mvn clean install或者****mvn clean install -DskipTests=true(下載所需jar)回車。