【发布时间】:2012-07-12 19:25:13
【问题描述】:
我刚刚在 Ubuntu 12.04(32 位)上安装了 Eclipse Juno,并下载了 Eclipse Web Developer Tools。我创建了一个新的静态 Web 项目,但无法为目标运行时创建/使用 HTTP 预览来测试/运行我的项目。有人知道这是否可能吗?如果是这样,我该怎么做?
【问题讨论】:
我刚刚在 Ubuntu 12.04(32 位)上安装了 Eclipse Juno,并下载了 Eclipse Web Developer Tools。我创建了一个新的静态 Web 项目,但无法为目标运行时创建/使用 HTTP 预览来测试/运行我的项目。有人知道这是否可能吗?如果是这样,我该怎么做?
【问题讨论】:
您可以在以下四个阶段创建补丁并使其适用于您拥有的 Eclipse Juno 版本。它有点冗长,但它有效
<strong>Phase 1</strong>: Create a plug-in project for the plug-in you need to patch.
File -> Import
Plug-in Development,选择Plug-ins and Fragments,然后点击Next
Import As 部分中,选择Projects with source folders
然后点击Next。org.eclipse.wst.server.preview.adapter 进入顶部的 ID 字段和
点击Add All。这应该会将这个插件移动到右侧窗格中。Finish导入“org.eclipse.wst.server.preview.adapter”
插件源到项目中。<strong>Phase 2</strong>: Apply the changes needed to update the plug-in. Since there is a bug with a patch attached that can be used to apply the changes, the following steps will take advantage of that.
Patch v1.0 for 3.4.2p附件链接打开补丁。--- 开头的行开始,
通过文本末尾选择这一行并将其复制到剪贴板。这包含对 PreviewLaunchConfigurationDelegate.java 文件的更改,该文件是修复所在
需要。您不希望补丁的上部,因为这会改变插件的版本,这会使事情变得复杂。Team,然后点击Apply Patch。Next。Next。Ignore leading path name segments 设置为 3。“补丁
内容”窗口应更改为有一个蓝色的左箭头
而不是红色的 x 指示符。Finish 应用更改。<strong>Phase 3:</strong> Create the replacement jar. Due to the approach in Phase 1, the name of this jar will be identical to your current jar, which simplifies updating the Eclipse installation.
org.eclipse.wst.server.preview.adapter 项目并选择Export
Plug-in Development,选择Deployable plug-ins and
fragments,然后点击Next
Browse 按钮,然后单击“确定”。这会将输出目录设置为与您的工作区相同。Finish构建替换插件jar。会出现在
工作区根目录下的“插件”文件夹。<strong>Phase 4:</strong> Replace the installed plug-in jar with the fixed version.
您现在应该可以使用固定插件运行 Eclipse。由于修补后的 jar 具有相同的版本号,因此无需进行额外更改。
【讨论】:
我不熟悉您正在使用的工具,但我在 12.04 上使用 eclipse 的内部浏览器时遇到了很大问题,因为它试图使用 mozilla 的 XULRunner。由于 Mozilla 的发布周期,XULRunner 的包装在 12.04 中发生了变化,并且没有单独包含在 repo 中。我通过在 config.ini 的 vmargs 部分中设置以下属性来强制我的 Eclipse 使用 WebKit
-Dorg.eclipse.swt.browser.DefaultType=webkit
这解决了我的问题 - 希望这对你有帮助。
【讨论】: