【问题标题】:No HTTP Preview server for Eclipse Juno in Ubuntu 12.04Ubuntu 12.04 中没有用于 Eclipse Juno 的 HTTP 预览服务器
【发布时间】:2012-07-12 19:25:13
【问题描述】:

我刚刚在 Ubuntu 12.04(32 位)上安装了 Eclipse Juno,并下载了 Eclipse Web Developer Tools。我创建了一个新的静态 Web 项目,但无法为目标运行时创建/使用 HTTP 预览来测试/运行我的项目。有人知道这是否可能吗?如果是这样,我该怎么做?

【问题讨论】:

    标签: eclipse ubuntu


    【解决方案1】:

    您可以在以下四个阶段创建补丁并使其适用于您拥有的 Eclipse Juno 版本。它有点冗长,但它有效

    <strong>Phase 1</strong>: Create a plug-in project for the plug-in you need to patch.

    1. 创建一个新工作区(推荐)或打开一个现有工作区。
    2. 选择File -> Import
    3. 展开Plug-in Development,选择Plug-ins and Fragments,然后点击Next
    4. Import As 部分中,选择Projects with source folders 然后点击Next
    5. 输入(或复制和粘贴,无引号) org.eclipse.wst.server.preview.adapter 进入顶部的 ID 字段和 点击Add All。这应该会将这个插件移动到右侧窗格中。
    6. 点击Finish导入“org.eclipse.wst.server.preview.adapter” 插件源到项目中。
    7. 展开项目的根目录并确保它包含一个名为 “源”。如果您有“WST 服务器”,您只会获得“src”文件夹 适配器插件开发人员资源”已安装。

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

    1. 在浏览器中打开Bug 402848
    2. 点击Patch v1.0 for 3.4.2p附件链接打开补丁。
    3. 从第二次出现以--- 开头的行开始, 通过文本末尾选择这一行并将其复制到剪贴板。这包含对 PreviewLaunchConfigurationDelegate.java 文件的更改,该文件是修复所在 需要。您不希望补丁的上部,因为这会改变插件的版本,这会使事情变得复杂。
    4. 返回 Eclipse,右键单击“org.eclipse.wst.server.preview.adapter”项目。选择Team,然后点击Apply Patch
    5. 选择剪贴板并点击Next
    6. 确保“org.eclipse.wst.server.preview.adapter”项目是 选中,然后点击Next
    7. Ignore leading path name segments 设置为 3。“补丁 内容”窗口应更改为有一个蓝色的左箭头 而不是红色的 x 指示符。
    8. 点击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.

    1. 在项目浏览器或其他导航器视图中右键单击org.eclipse.wst.server.preview.adapter 项目并选择Export
    2. 展开Plug-in Development,选择Deployable plug-ins and fragments,然后点击Next
    3. 单击“目标”选项卡中“目录”选项旁边的Browse 按钮,然后单击“确定”。这会将输出目录设置为与您的工作区相同。
    4. 点击Finish构建替换插件jar。会出现在 工作区根目录下的“插件”文件夹。

    <strong>Phase 4:</strong> Replace the installed plug-in jar with the fixed version.

    1. 如果 Eclipse 正在运行,请退出它。
    2. 在 Eclipse 安装的“plugins”文件夹下,移动或 重命名 org.eclipse.wst.server.preview.adapter_1.1.101.v20121107_1651.jar 如果你 不想用补丁版本覆盖它(在下面的步骤 3 中提到)。如果您有不同的版本,则表示您没有使用 Juno SR2,希望您安装了与您的版本匹配的“WST 服务器适配器插件开发人员资源”。
    3. 复制org.eclipse.wst.server.preview.adapter_1.1.101.v20121107_1651.jar 工作区下的“plugins”文件夹,并将其粘贴到 Eclipse 安装的“plugins”文件夹中。

    您现在应该可以使用固定插件运行 Eclipse。由于修补后的 jar 具有相同的版本号,因此无需进行额外更改。

    【讨论】:

    • 如何安装“WST 服务器适配器插件开发者资源”?谢谢!
    【解决方案2】:

    我不熟悉您正在使用的工具,但我在 12.04 上使用 eclipse 的内部浏览器时遇到了很大问题,因为它试图使用 mozilla 的 XULRunner。由于 Mozilla 的发布周期,XULRunner 的包装在 12.04 中发生了变化,并且没有单独包含在 repo 中。我通过在 config.ini 的 vmargs 部分中设置以下属性来强制我的 Eclipse 使用 WebKit

    -Dorg.eclipse.swt.browser.DefaultType=webkit
    

    这解决了我的问题 - 希望这对你有帮助。

    【讨论】:

    • 嗨,我想通了。问题是我没有安装特定的软件来启用 HTTP 预览(以及 HTTP 服务器和 J2EE 预览)。解决方案是卸载单个 Eclipse Web Developer Tools 并安装整个 Web、XML、Java EE 和 OSGi Enterprise Development 包(包括 Eclipse Web Developer Tools)。顺便说一句,如果您为 Java EE Developers 安装 Eclipse IDE,那么您将不会遇到这个问题。我安装了 Eclipse Classic 并尝试安装其他软件。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-14
    • 2015-01-20
    相关资源
    最近更新 更多