英文:
Installing Eclipse PDE Plugin in Windows
问题
在Windows环境中,我在尝试使我的Eclipse PDE插件工作时遇到了困难。我已经创建了一个使用外部JAR文件的Eclipse PDE插件。在我的MacBook上(macOS Catalina 10.15),我能够通过右键单击项目,然后选择导出>可部署的插件和片段>安装到主机存储库>完成来将插件安装到我的Eclipse IDE中。主机存储库的路径为/Users/username/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/install/
。在“选项”类别中选择的属性如下所示:
插件安装成功,并且能够在我的IDE中通过按钮点击运行。
但是,当我在Windows 10中重复这些步骤时,插件安装成功。我可以单击一个按钮打开我的开发窗口,但是当我单击触发依赖于外部JAR文件的功能的“go”按钮时,什么都不会发生。按钮表现得好像没有连接到任何函数,尽管代码与Mac上使用的代码完全相同。是否有人知道为什么Eclipse无法在Windows中访问所需的JAR文件?
我附上了我的构建属性的屏幕截图如下。请注意,这些JAR文件存放在与eclipse插件项目中的/src目录在同一级别的名为“lib”的目录中。
<!-- language: none -->
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-work
英文:
I am having difficulty getting my Eclipse PDE plugin to work in a Windows environment. I have created an Eclipse PDE plugin that uses external jars. I was able to install the plugin to my Eclipse IDE on my MacBook (macOS Catalina 10.15), by right clicking on the project then Export>Deployable plugins and Fragments>Install into host repository>Finish. The pathway for the host repository is /Users/username/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/install/
. The attributes chosen in the Options category are shown in the photo below:
The plugin installs successfully and is able to run in my IDE upon button click.
When I repeat these steps in Windows 10, the plugin installs. I am able to click on a button to open my developed window, but when I click the "go" button which triggers my functions that rely on the external jars, nothing occurs. The button acts as though it is not connected to any function, despite the code being identical to what was used in Mac. Does anyone know why Eclipse is unable to access the necessary jars in Windows?
I have attached a screenshot of my build properties below. Note that the jars are held in a directory called "lib" which is at the same level as the /src directory in a eclipse plugin project.
<!-- language: none -->
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,\
.
The plugin manifest is as shown below:
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,
.
I get the following errors in the C:\Users\userName\eclipse-workspace.metadata.log when trying to install the plugin in Windows. All of the methods below that are unable to be resolved are from the external jars that have been added to the project.
!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)
答案1
得分: 0
Update: 问题似乎出现在我使用的Windows电脑上。在另一台Windows机器上,该插件按照预期安装了这个代码。
英文:
Update: the issue appeared to be with the windows computer I was using. The plugin installed as intended with this code on another windows machine.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论