简体   繁体   中英

No HTTP Preview server for Eclipse Juno in Ubuntu 12.04

I just installed Eclipse Juno on Ubuntu 12.04 (32-bit) and downloaded the Eclipse Web Developer Tools. I created a new Static Web Project but cannot create/use HTTP Preview for the Target runtime to test/run my project. Does anybody know whether this is possible? If so, how would I do this?

You can create the patch and make it work for the Eclipse Juno version you have in the following four phases. Its a bit lengthy but it works

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

  1. Create a new workspace (recommended) or open an existing one.
  2. Select File -> Import
  3. Expand Plug-in Development , select Plug-ins and Fragments , then click Next
  4. In the Import As section, select Projects with source folders and then click Next .
  5. Enter (or copy & paste, no quotes) org.eclipse.wst.server.preview.adapter into ID field at the top and click Add All . This should move this one plug-in to the right pane.
  6. Click Finish to import the "org.eclipse.wst.server.preview.adapter" plug-in source into a project.
  7. Expand the root of the project and ensure it contains a folder named "src". You will only get the "src" folder if you have the "WST Server Adapter Plug-in Developer Resources" installed.

Phase 2 : 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 Phase 2 : 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. Open Bug 402848 in a browser.
  2. Click on the Patch v1.0 for 3.4.2p attachment link to open the patch.
  3. Starting with the second occurrence of a line starting with --- , select this line through the end of the text and copy it to the clipboard. This contains the changes to the PreviewLaunchConfigurationDelegate.java file which is where the fix is needed. You don't want the upper portion of the patch as that would change the version of the plug-in, and that would complicate things.
  4. Back in Eclipse, right-click on the "org.eclipse.wst.server.preview.adapter" project. Select Team and click on Apply Patch .
  5. Leave Clipboard selected and click Next .
  6. Ensure the "org.eclipse.wst.server.preview.adapter" project is selected, and click Next .
  7. Set the Ignore leading path name segments to 3. The "Patch Contents" window should change to have a blue left pointing arrow instead of red x indicators.
  8. Click Finish to apply the changes.

Phase 3: 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. Right-click on the org.eclipse.wst.server.preview.adapter project in the Project Explorer or other navigator view and select Export
  2. Expand Plug-in Development , select Deployable plug-ins and fragments , then click Next
  3. Click the Browse button next to the Directory selection in the Destination tab followed by OK. This will set the output directory to be the same as your workspace.
  4. Click Finish to build the replacement plug-in jar. It will appear in a "plugins" folder under the root of your workspace.

Phase 4: Replace the installed plug-in jar with the fixed version.

  1. Exit Eclipse if it is running.
  2. Under the "plugins" folder of your Eclipse installation, move or rename the org.eclipse.wst.server.preview.adapter_1.1.101.v20121107_1651.jar if you don't want to overwrite it with the patched version (mentioned in step 3 below). If you have a different version, it means you aren't using Juno SR2 and hopefully you installed the "WST Server Adapter Plug-in Developer Resources" that matched your version.
  3. Copy the org.eclipse.wst.server.preview.adapter_1.1.101.v20121107_1651.jar from the "plugins" folder under your workspace and paste it to the "plugins" folder of your Eclipse installation.

You should be able to run Eclipse now with the fixed plug-in. Because the patched jar had the same version number, no additional changes are needed.

I'm not familiar with the tooling you're using, but I had big problems with eclipse's internal browser on 12.04 as it was trying to use mozilla's XULRunner. The packaging of XULRunner has changed in 12.04 due to mozilla's release cycle, and isn't included in the repo independently. I forced my eclipse to use WebKit, by setting the following property in the vmargs section of my config.ini

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

This sorted my issues out - hope this helps with yours.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM