2012-06-24 35 views
0

我想出了試圖編譯其中有註釋@Access(AccessType.FIELD)javac的編制問題

Failure executing javac, but could not parse the error: An exception has occurred in the compiler (1.6.0_20).

Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking Parade for duplicates. Include your program and the following diagnostic Thank you.

tools.javac.code.Symbol$CompletionFailure : class file for javax.persistence.AccessType not found. Build error

一個項目,如何在Java解析器修復這個錯誤時,下面的錯誤? 我使用elcipselink和eclipse作爲IDE。

+0

可能'EJB3-persistence.jar'是在類路徑中缺少什麼? – Chandra

+0

我在我的班級路徑中有。 –

回答

0

可能是你的JPA JAR的版本:只因爲JPA 2.0此註釋已被使用,根據的Javadoc:

http://docs.oracle.com/javaee/6/api/javax/persistence/AccessType.html

+0

我正在使用jpa 2.0。 –

+0

你可以在你的CLASSPATH中的JAR中找到該註釋嗎?如果不是的話,類加載器也無法做到。 – duffymo

+0

是的,jar是在我的類路徑中,當我按下Ctrl +鼠標右鍵單擊時,我能夠訪問@Access註釋代碼。但是,javac編譯器給我一個問題。 –