2012-01-31 148 views
2

構建路徑選項不可用時,我右鍵單擊我想包括的一個罐子。任何人都知道爲什麼?謝謝!我使用的Eclipse版本是
的Eclipse SDK 版本:3.7.1 版本ID:M20110909-1335
enter image description hereEclipse構建路徑不可用

+1

請不要裁剪圖像多。什麼類型的項目?什麼建設者?哪個角度?哪個視圖? – 2012-01-31 20:51:04

回答

6

右鍵單擊該項目,選擇 '屬性'。在「Java構建路徑」中,轉到「庫」選項卡,然後單擊「添加JAR」,將工作區的jar包含在Java項目的構建路徑中。

+3

Java構建路徑不是屬性中的一個選項 – 2016-12-15 05:51:14

5

確保u有以下所有, 1)設置文件夾 2)的.classpath 3)。項目 只需複製這段粘貼項目文件,清理並構建它,

<?xml version="1.0" encoding="UTF-8"?> 
<projectDescription> 
    <name>XXXX</name> 
    <comment></comment> 
    <projects> 
    </projects> 
    <buildSpec> 
     <buildCommand> 
      <name>org.eclipse.jdt.core.javabuilder</name> 
      <arguments> 
      </arguments> 
     </buildCommand> 
    </buildSpec> 
    <natures> 
     <nature>org.eclipse.jdt.core.javanature</nature> 
    </natures> 
</projectDescription> 
2

在工具欄菜單中,單擊「窗口 - >顯示視圖> Package Explorer中

這應該可以解決這個問題

-1

如果您正在使用一個OSGi運行配置,運行 - >運行Configuratio ns ...選擇你的laucher並點擊Bundles選項卡。使用org.eclipse.swt過濾並確保org.eclipse.swt和org.eclipse.swt。[arch]。[version] .jar被選中。

這使我瘋狂,直到我做了這件簡單的事情。如果您沒有檢查這些包,就會得到一個「沒有問題」的對話框,但是在運行時會出現這個錯誤

+0

沒有捆綁選項卡 – gonephishing 2016-08-13 17:20:45

+0

在左側窗口中展開「OSGi框架」。點擊或創建啓動器,Bundles選項卡將出現。 – mister270 2016-08-15 18:46:02

0

轉到您的項目工作區=>在項目根文件夾裏面。您會看到.project文件打開並替換它。

<?xml version="1.0" encoding="UTF-8"?> 
<projectDescription> 
    <name>Test</name> 
    <comment></comment> 
    <projects> 
     </projects> 
    <buildSpec> 
     <buildCommand> 
      <name>org.eclipse.jdt.core.javabuilder</name> 
      <arguments> 
      </arguments> 
     </buildCommand> 
     <buildCommand> 
      <name>org.maven.ide.eclipse.maven2Builder</name> 
      <arguments> 
      </arguments> 
     </buildCommand> 
     <buildCommand> 
      <name>org.eclipse.m2e.core.maven2Builder</name> 
      <arguments> 
      </arguments> 
     </buildCommand> 
    </buildSpec> 
    <natures> 
     <nature>org.maven.ide.eclipse.maven2Nature</nature> 
     <nature>org.eclipse.jdt.core.javanature</nature> 
     <nature>org.eclipse.m2e.core.maven2Nature</nature> 
    </natures> 
</projectDescription> 
3
  1. 右鍵單擊該項目並選擇屬性。 2.項目構面 - > java - >應用
0

不知道原因。但這對我很有用,所以發佈它。該項目

右擊 - > '屬性' - > 'Java構建路徑'

enter image description here

enter image description here