[英]Installing Eclipse PDE Plugin in Windows
我很難讓我的 Eclipse PDE 插件在 Windows 環境中工作。 我創建了一個使用外部 jars 的 Eclipse PDE 插件。 我能夠將插件安裝到我的 MacBook(macOS Catalina 10.15)上的 Eclipse IDE,方法是右鍵單擊項目然后導出>可部署插件和片段>安裝到主機存儲庫>完成。 主機存儲庫的路徑是/Users/username/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/install/
。 在選項類別中選擇的屬性如下圖所示:
該插件安裝成功,並且能夠在我的 IDE 單擊按鈕時運行。
當我在 Windows 10 中重復這些步驟時,插件就會安裝。 我可以單擊一個按鈕來打開我開發的 window,但是當我單擊“開始”按鈕觸發我依賴外部 jars 的功能時,什么也沒有發生。 盡管代碼與 Mac 中使用的代碼相同,但該按鈕的作用就像它沒有連接到任何 function 一樣。 有誰知道為什么 Eclipse 無法訪問 Windows 中必要的 jars 嗎?
我在下面附上了我的構建屬性的屏幕截圖。 請注意,jars 保存在名為“lib”的目錄中,該目錄與 eclipse 插件項目中的 /src 目錄處於同一級別。
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
lib/commons-io-2.6.jar,\
lib/daffodil-io_2.12-2.5.0.jar,\
lib/daffodil-japi_2.12-2.5.0.jar,\
lib/daffodil-lib_2.12-2.5.0.jar,\
lib/daffodil-runtime1_2.12-2.5.0.jar,\
lib/daffodil-runtime1-unparser_2.12-2.5.0.jar,\
lib/daffodil-udf_2.12-2.5.0.jar,\
lib/icu4j-62.1.jar,\
lib/jackson-core-2.9.6.jar,\
lib/jdom2-2.0.6.jar,\
lib/jline-2.14.6.jar,\
lib/scala-library-2.12.6.jar,\
lib/scala-parser-combinators_2.12-1.1.1.jar,\
lib/scala-xml_2.12-1.1.0.jar,\
lib/stax2-api-4.1.jar,\
lib/daffodil-core_2.12-2.5.0.jar,\
lib/woodstox-core-5.1.0.jar,\
lib/xercesImpl-2.12.0.jar,\
lib/xml-apis-1.4.01.jar,\
lib/xml-resolver-1.2.jar
jars.compile.order = lib/scala-library-2.12.6.jar,\
lib/scala-xml_2.12-1.1.0.jar,\
lib/scala-parser-combinators_2.12-1.1.1.jar,\
lib/commons-io-2.6.jar,\
lib/daffodil-io_2.12-2.5.0.jar,\
lib/daffodil-japi_2.12-2.5.0.jar,\
lib/daffodil-lib_2.12-2.5.0.jar,\
lib/daffodil-runtime1_2.12-2.5.0.jar,\
lib/daffodil-runtime1-unparser_2.12-2.5.0.jar,\
lib/daffodil-udf_2.12-2.5.0.jar,\
lib/icu4j-62.1.jar,\
lib/jackson-core-2.9.6.jar,\
lib/jdom2-2.0.6.jar,\
lib/jline-2.14.6.jar,\
lib/stax2-api-4.1.jar,\
lib/daffodil-core_2.12-2.5.0.jar,\
lib/woodstox-core-5.1.0.jar,\
lib/xercesImpl-2.12.0.jar,\
lib/xml-apis-1.4.01.jar,\
lib/xml-resolver-1.2.jar,\
.
插件清單如下圖所示:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Plugin
Bundle-SymbolicName: com.companyName.plugin;singleton:=true
Bundle-Version: 1.0.0.0
Bundle-Vendor: VENDOR
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.jface.text,
org.eclipse.ui.editors,
org.eclipse.core.resources
Automatic-Module-Name: com.companyName.plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: lib/commons-io-2.6.jar,
lib/daffodil-io_2.12-2.5.0.jar,
lib/daffodil-japi_2.12-2.5.0.jar,
lib/daffodil-lib_2.12-2.5.0.jar,
lib/daffodil-runtime1_2.12-2.5.0.jar,
lib/daffodil-runtime1-unparser_2.12-2.5.0.jar,
lib/daffodil-udf_2.12-2.5.0.jar,
lib/icu4j-62.1.jar,
lib/jackson-core-2.9.6.jar,
lib/jdom2-2.0.6.jar,
lib/jline-2.14.6.jar,
lib/scala-library-2.12.6.jar,
lib/scala-parser-combinators_2.12-1.1.1.jar,
lib/scala-xml_2.12-1.1.0.jar,
lib/stax2-api-4.1.jar,
lib/daffodil-core_2.12-2.5.0.jar,
lib/woodstox-core-5.1.0.jar,
lib/xercesImpl-2.12.0.jar,
lib/xml-apis-1.4.01.jar,
lib/xml-resolver-1.2.jar,
.
嘗試在 Windows 中安裝插件時,我在 C:\Users\userName\eclipse-workspace.metadata.log 中收到以下錯誤。 以下所有無法解決的方法均來自已添加到項目中的外部jars。
!ENTRY org.eclipse.ui 4 0 2020-07-21 16:42:07.814
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.Error: Unresolved compilation problems:
DataProcessor cannot be resolved to a type
The method createDataProcessor(File) from the type DaffFunct refers to the missing type DataProcessor
InputSourceDataInputStream cannot be resolved to a type
InputSourceDataInputStream cannot be resolved to a type
InfosetOutputter cannot be resolved to a type
InfosetOutputter cannot be resolved to a type
XMLTextInfosetOutputter cannot be resolved to a type
JsonInfosetOutputter cannot be resolved to a type
ParseResult cannot be resolved to a type
Diagnostic cannot be resolved to a type
Diagnostic cannot be resolved to a type
at com.nteligen.daffodil.handlers.DaffFunct.parse(DaffFunct.java:62)
at com.nteligen.daffodil.handlers.ParseHandler$6.handleEvent(ParseHandler.java:233)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4105)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3922)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3524)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
更新:問題似乎與我使用的 windows 計算機有關。 在另一台 windows 機器上按預期安裝插件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.