1. 程式人生 > >eclipse 中匯入原始碼出現 The declared package does not match the expected package的解決方法

eclipse 中匯入原始碼出現 The declared package does not match the expected package的解決方法

eclipse 匯入專案,有時候會出現 java 檔案圖示由實心J變成空心J的問題,這個時候是不能編輯原始檔的,至於解決辦法就是右鍵該資料夾 – >BuildPath –> use as source folder

當以上問題解決後,如果你選擇的檔案路徑不對,開啟一個 java 檔案就會出現首行的包命報錯,The declared package does not match the expected package,這個主要是右鍵檔案的時候,沒有定位到正確的位置,這個問題的解決辦法就是先從 source folder 移除掉你新增的檔案,然後定位到你包名的上一級目錄,如 java檔案包名為 com.eaphy.platform.patch.slogon.action ,報錯提示包名應該是 java.com.eaphy.platform.patch.slogon.action ,那麼,右鍵的資料夾就應該在 java 這一級,然後 BuildPath –> use as source folder 這樣就ok了

這裡寫圖片描述

相關推薦

eclipse 匯入原始碼出現 The declared package does not match the expected package解決方法

eclipse 匯入專案,有時候會出現 java 檔案圖示由實心J變成空心J的問題,這個時候是不能編輯原始檔的,至於解決辦法就是右鍵該資料夾 – >BuildPath –> use as source folder 當以上問題解決後,如果你選擇的檔

如何處理Eclipse錯誤訊息 The declared package does not match the expected package

我從github下載了一個開源專案後,匯入到自己Eclipse之後,遇到了這個煩人的錯誤訊息: The declared package "com.sap.smartService" does not match the expected package "main.java.com.sap.smartSer

如何處理Eclipse錯誤消息 The declared package does not match the expected package

下載 分享 開源項目 錯誤 rop cte 是我 遇到 images 我從github下載了一個開源項目後,導入到自己Eclipse之後,遇到了這個煩人的錯誤消息: The declared package "com.sap.smartService" does not m

eclipse重新整理maven專案後出現Java compiler level does not match the version of the installed Java project face

如果出現標題所示的問題這裡提供一個根除的方法: 需要找到maven安裝路徑conf子路徑下的setting.xml檔案,開啟<profile>標籤指定你的jdk編譯版本即可,如下所示: <profile>       

解決The declared package..does not match the expected package..

在MyEclipse中編寫Java程式碼時,用到了BASE64Decoder,import sun.misc.BASE64Decoder;可是Eclipse提示: Access restriction : The type BASE64Decoder is not accessible due to res

解決The declared package..does not match the expected package..(轉自百度空間)

Volatile修飾的成員變數在每次被執行緒訪問時,都強迫從共享記憶體中重讀該成員變數的值。而且,當成員變數發生變化時,強迫執行緒將變化值回寫到共享記憶體。這樣在任何時刻,兩個不同的執行緒總是看到某個成員變數的同一個值。 Java語言規範中指出:為了獲得最佳速度,允許執行緒儲存共享成員變數的私有拷貝,而且

新導入項目出現Java compiler level does not match the version of the installed java project facet問題處理

ima project 編譯 分享 face bsp 導入 ets 操作   在使用eclipse開發java類項目的時候,免不了會在不同的設備上開發編譯同一個項目,那麽就會出現Java compiler level does not match the version o

eclipse匯入專案出現小紅叉卻找不到錯誤之處的解決辦法

昨天看使用JSON和jQuery實現Ajax的專案案例,專案功能是關鍵字搜尋自動提示。我想先看一下執行效果再去分析程式碼,結果匯入後項目中出現小紅叉,然而卻找不到錯誤頁面。點選error Pages進入web.xml頁面,仔細檢查後沒有發現錯誤,嘗試更改後依然出現小紅叉,然

報錯:The declared package "com.cas" does not match the expected package "main.java.com.cas"

1 、說明 環境說明:2018eclipse + jdk1.8 + tomcat 8 經常搗騰開發環境,昨天還好好的,今天來了,突然發現 所有的類都報錯,這可如何是好,措手不及的感覺有木有0.0,

the declared package does not match 解決辦法

the declared package does not match 很可能是包名不合規則所造成的,比如包名字上面有特殊符號。最簡單的解決辦法就是更改包名稱。 在專案上面單擊右鍵 選擇Refactor

CentOS 使用yum出現的“UnicodeDecodeError: &#39;ascii&#39; codec”問題解決方法

dede epo from use line speed 方式 set art 問題 新裝了CentOS 6.5系統,打算使用yum安裝程序是出現了例如以下錯誤: Loading mirror speeds from cached hostfile Traceback

Android匯入專案出現“R cannot be resolved to a variable"錯誤的解決方法

1、選中該專案,右鍵properties,選中Android的Project Build Target 中版本最高的一項,並點選Apply ->OK。如下圖 2、選中Project,選中C

關於eclipseThe source attachment does not contain the source for the file找不到類的說明

關於eclipse的The source attachment does not contain the source for the file找不到類的說明 在attach source中新增Fo

從SVN上檢出Maven專案報紅叉錯誤,package錯誤 does not match the expected package "main.java.com.*

不知道為什麼有時候從SVN上檢出maven專案時,專案總是丟失資原始檔,然後就會出現以下的錯誤,does not match the expected package "main.java.com.* 這是由於build path 沒有載入到資原始檔目錄,右鍵點選專

用maven在eclipse建立web專案時不能建立三個資料夾的解決方法

我報的這錯,是因為我先用了一個版本的eclipse,並且也在其中把maven配置了,但使用maven建立web過程中,沒有maven專案轉換成web專案,所以換了eclipse的另一個版本,我在用新版本時,也重用了之前的eclipse的workspace,下面的錯便順理成章

IDEA檢視原始碼時提示:Library source does not match the bytecode for class的問題分析

通過Maven檢視依賴的原始碼時,通常是Maven自動下載JAR包附屬的source包,但是會出現一個問題,由於使用lombok外掛會造成編寫的Java檔案和編譯後的class上有差別,所以IDEA開啟時看到的是Maven打包時用的原始碼,而IDEA會自動匹配與

ideadebug的時候顯示紅色的 sources code does not match the bytecode

程式設計軟體:IntelliJ IDEA 2018.1.2 (Ultimate Edition)前置條件:專案正常啟動復現步驟:    1.修改該controller對應的serviceimpl區域程式碼。    2.繼續進行debug實際結果:    顯示紅色的source

Java compiler level does not match the version of the installed Java project facet

led epo sin eclips path tar repo alt rip 更換jdk版本時報以下問題:Description Resource Path Location TypeJava compiler level does not match the vers

Type Java compiler level does not match the version of the installed Java project facet.項目內容沒錯但是項目上報錯,不影響運行

images ems rop http ges 內容 工程 版本 ren 1、Window->Show View->Problems 2、在項目上右鍵properties->project Facets->修改右側的version 保持一致 3

Java問題解決:Java compiler level does not match the version of the installed Java project facet.

問題 compiler .cn 技術分享 cnblogs java編譯 mpi 選中 per 問題原因:Java編譯器級別與Facted Project 中的Java 版本設定不匹配。 解決辦法:將兩者設置一致 1.查看Java compiler level :   選中項