0

私は Eclipse Indigo を使用していますが、以前は Ganymede で正常に動作していたコードをコンパイルできません。次のクラスをインポートできません。

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 Marketplace で SWT を検索しようとしましたが、ライブラリが見つかりませんでした。また、自分のプロジェクトを再構築するように言っている他の記事を読み (実際に実行しました)、他の記事では「JAR」のダウンロードを勧めています。ダウンロードする必要があるJARを誰か知っていますか? または、これらの SWT ライブラリが含まれるようにビルド パスを修正する方法を教えてください。

クラスパス (DannyGui が 2 回存在する必要があります):

<?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>

前もって感謝します。

4

2 に答える 2

0

投稿された.classpathファイルには、SWTクラスをロードできる場所からは何も含まれていません。このプロジェクトは、どのバージョンのEclipseでもそうであるようにはビルドされません。

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

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

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

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

于 2011-07-15T19:52:57.940 に答える
0

3.7 の最新の swt: http://download.eclipse.org/eclipse/downloads/drops/R-3.7-201106131736/index.php#SWT

于 2011-07-16T14:26:53.303 に答える