2011-07-15 6 views
0

Eclipse Indigoを使用していますが、Ganymedeでうまく動作していたコードをコンパイルできません。org.eclipse.swt.widgets.XXXのクラスファイルが見つかりません

import org.eclipse.swt.SWT; 
import org.eclipse.swt.custom.CTabFolder; 
import org.eclipse.swt.custom.CTabItem; 
import org.eclipse.swt.layout.GridData; 
import org.eclipse.swt.layout.GridLayout; 
import org.eclipse.swt.widgets.Composite; 

EclipseマーケットプレイスでSWTを検索しようとしましたが、ライブラリを見つけることができませんでした。また、私は自分のプロジェクト(私がやった)を再構築すると言う他の記事を読んで、他の人は "JAR"をダウンロードすることを勧めます。誰かがダウンロードする必要があるJARを知っていますか?または、これらのSWTライブラリを含むように私のビルドパスを修正する方法は?

クラスパス(DannyGuiは二回があるはずです):事前に

<?xml version="1.0" encoding="UTF-8"?> 
<classpath> 
<classpathentry kind="src" path="com.danny.DannyGui.plugin/src"/> 
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JFreeChart/swtgraphics2d.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/antlr/stringtemplate-3.2.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/antlr/antlr-2.7.7.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/antlr/antlr-3.1.3.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/antlr/antlr-runtime-3.1.3.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/antlr/gunit.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JacORB/wrapper-3.1.0.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JacORB/antlr-2.7.2.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JacORB/avalon-framework-4.1.5.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JacORB/backport-util-concurrent.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JacORB/idl.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JacORB/jacorb.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JacORB/logkit-1.2.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JacORB/picocontainer-1.2.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JFreeChart/gnujaxp.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JFreeChart/iText-2.1.3.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JFreeChart/jcommon-1.0.15.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JFreeChart/jfreechart-1.0.12.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JFreeChart/jfreechart-1.0.12-experimental.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JFreeChart/jfreechart-1.0.12-swt.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JFreeChart/junit.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/JFreeChart/servlet.jar"/> 
<classpathentry exported="true" kind="lib" path="C:/DannyGui/DannyGui/com.danny.DannyGui.plugin/third_party_libs/log4j/log4j-1.2.15.jar"/> 
<classpathentry kind="output" path="bin"/> 
</classpath> 

感謝。

+0

私は追加する必要があり、ここに私の実際のエラーがある:そのビルドパスが不完全であるため、プロジェクトはビルドされませんでした。 org.eclipse.swt.widgets.Compositeのクラスファイルが見つかりません。ビルドパスを修正し、このプロジェクトをビルドしてみてください。ビルドパスが不完全なので、プロジェクトはビルドされませんでした。 org.eclipse.swt.widgets.Compositeのクラスファイルが見つかりません。ビルドパスを修正し、このプロジェクトをビルドしてみてください。 –

+0

プロジェクトの.classpathファイルの内容を投稿できますか? –

+0

クラスパスが追加されました... –

答えて

0

投稿された.classpathファイルには、SWTクラスをロードできる場所はありません。このプロジェクトは、Eclipseのどのバージョンでも構築されません。

(Eclipseプラグインとは対照的に)スタンドアロンのSWTアプリケーションとしてビルドしようとしているようです。スタンドアロンアプリでは、クラスパス上にSWTライブラリが必要です。 Eclipseを拡張するプラグインを探しているわけではないので、Eclipse MarketplaceでSWTを探す必要はありません。依存するプロジェクトのライブラリを探しています。 SWTは、システムのどこかで解凍したzipとしてダウンロードします。 zipには、SWT実装の一部である.jarファイルとネイティブライブラリが含まれています。

あなたに直接のリンクを提供するのではなく、それを見つける方法を示します。 Eclipseのプラットフォームのダウンロードサイトで開始します。

http://download.eclipse.org/eclipse/downloads/

開発ビルド無視します。最新のリリースを見てください。今、それは3.7になるでしょう。ビルドページへのリンクをたどります。下に向かってSWTを探してください。システムに適したzipをダウンロードしてください。それを抽出し、プロジェクトのクラスパスからインクルードされたjarへの参照を追加します。

+0

OK、そうです... - Eclipse Package Explorerでプロジェクトを右クリックし、Propertiesを選択し、左側のJava Build Pathをクリックします。 - [Add External JARs ...]ボタンをクリックします。 - <自分のEclipseホーム> \ plugins \ org.eclipse.swt_3.7.0.v3735b.jarとorg.eclipse.swt.win32.win32.x86_3.7.0.v3735b.jar(あなたのホームディレクトリは、ダウンロードしたもの@コンスタンチンが言及しているように、あるいはあなたのEclipseホームディレクトリにファイルがあれば、特定の名前をあなたのOSとSWTのビルドと一致するものに変更する)。 - 次に、プロジェクトをきれいにして再構築します。 ありがとうございました@コンスタンチン。 –

+0

はい、独自のEclipseインストールを指すこともできますが、この方法ではお勧めしません。それは、あなたが完了したときに何を配布する必要があるかを決める上であなたを助けるものではないので、最後にそれを並べ替えるためにスクランブルしています。将来的には問題を解決し、別のSWTディストリビューションをダウンロードしてください。 –

関連する問題