eclipse bug(五)常見問題
阿新 • • 發佈:2019-02-18
1、專案出現沒找到sessionFactory這個錯誤:解決方法:(需要src和res這兩個目錄都要在編譯中)專案右鍵--buildPath--source--addFolder--勾選res和src--ok
2、修改專案預設jdk:專案右鍵--buildPath--Libraries--選擇JRE System Library--Edit--選擇Workspacedefault JRE
3、專案有紅叉:
1、import以前的專案(problems中注意檢視),由於以前執行的原因,會報以下錯誤,但不影響操作:
Description Resource Path Location Type Target runtimeMyEclipse Tomcat v7.0 Unknown Faceted Project Problem
2.
即 /.settings/org.eclipse.wst.common.project.facet.core.xml
< ?xml version="1.0"encoding="UTF-8"?>
< ?faceted -project>
< ?runtime name="MyEclipse Tomcat v7.0">
< ?fixed facet="wst.jsdt.web">
< ?fixed facet="java">
< ?fixed facet="jst.web">
< ?installed facet="java"version="1.5">
< ?installed facet="jst.web"version="2.5">
< ?installed facet="jst.web.jstl"version="1.2">
< ?installed facet="web.struts2"version="2.1">
< ?installed facet="wst.jsdt.web"version="1.0">
< \/faceted>
< \/code>
< ?runtime name="MyEclipse Tomcat v7.0">
刪除,工程右鍵,refresh即可.
4、專案有紅色歎號專案右鍵--buildPath-- 看各個選項卡是否有失效的jar包或者路徑錯誤
5、專案匯入以後captcha驗證碼報錯:
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
Access restriction: The type JPEGCodec is not accessible dueto restriction on required library D:\eclipse\JDK7x64\jre\lib\rt.jar
2、[Project]-> Properties -> Java Build Path -> Libraries -> 刪掉JRE System Library
然後新增:AddLibrary -> JRE System Library -> Click OK
3、[Project]-> Properties -> Java Build Path -> Libraries -> 雙擊JRESystem Library ,改為“Workspace default JRE”
6、因工作的關係,Eclipse開發的Java專案拷來拷去,有時候會報一個很奇怪的錯誤。明明原始碼一模一樣,為什麼專案複製到另一臺機器上,就會報“java compiler level does not match the version of the installedjava project facet”錯誤呢?其實要解決也很簡單,在資源管理器下,找到專案所在的目錄,在.settings子目錄裡面,用文字編輯器開啟org.eclipse.wst.common.project.facet.core.xml配置檔案內容如下:
<?xml version="1.0"encoding="UTF-8"?>
<faceted-project>
<runtimename="com.genuitec.runtime.generic.jee70"/>
<fixed facet="jst.web"/>
<fixed facet="wst.jsdt.web"/>
<fixed facet="java"/>
<installed facet="java"version="1.7"/>
<installed facet="jst.web"version="3.1"/>
<installed facet="jst.web.jstl"version="1.2.2"/>
<installed facet="wst.jsdt.web"version="1.0"/>
</faceted-project>
<installed facet="java"version="1.7"/>eclipse中版本錯誤,作如下修改:滑鼠右鍵選擇專案,點選Properties,選擇Java Compiler,可以在視窗右邊看到編譯器版本勾選Enable project specific settings
勾選Use default compliance settings
將對應的版本選成與 version="1.7"一致