當我在添加新的AUTH XOAUTH2命令後嘗試編譯我的項目時出現以下錯誤。issueCommand(java.lang.String,int)在com.sun.mail.smtp.SMTPTransport中有私人訪問編譯錯誤
byte[] response = String.format("user=%s\1auth=Bearer %s\1\1", msg.getFrom(),
token).getBytes();
response = BASE64EncoderStream.encode(response);
transport.issueCommand("AUTH XOAUTH2 " + new String(response), 235);
issueCommand(java.lang.String,int) has private access in com.sun.mail.smtp.SMTPTransport
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error
我試圖包括<compilerarg value="-Xlint:unchecked"/>
,但仍然無法解決問題。所以我又增加了一個<compilerarg value="-Xlint:deprecation"/>
。但仍然說有錯誤。
這裏是編譯xml信息。
<javac source="1.6" target="1.6" srcdir="${src}" destdir="${build}" deprecation="no" debug="yes" listfiles="no">
注:我使用JavaMail 1.4版本 的Java類版本:1.4(48.0)
那麼添加選項後輸出是什麼? – Strelok
輸出變成這樣[[javac])注:某些輸入文件使用或覆蓋棄用的API。 [javac]注意:使用-Xlint:deprecation重新編譯以獲取詳細信息。 [javac] 1 error] – kitokid
我甚至使用 ,但無法解決問題。 –
kitokid