4

I am writing a plug-in for Eclipse Oxygen that allows External Tools to be run directly from toolbar buttons. When I right click the project and click Run As Eclipse Application I get a pop-up that shows the following errors

javax.xml.ws
    Missing Constraint: Import-Package: java.xml.bind; version="0.0.0"
    Missing Constraint: Import-Package: java.xml.bind.annotation; version="0.0.0"
org.apache.xmlrpc
    Missing Constraint: Import-Package: java.xml.bind; version="0.0.0"

If I click Continue, Eclipse launches with the plug-in and it operates correctly. I have tried following the advice here to open the 'Run Configuration' and select 'Add Required Bundles' (although using Add Required Plug-ins as there is no bundles button) but it doesn't help. I neither can see javax.xml.bind in the list nor a way to add it.

The project itself is very simple with the following dependencies

org.eclipse.core.runtime
org.eclipse.debug.ui
org.eclipse.jface

and extensions

org.eclipse.debug.core.launchers
org.eclipse.ui.commands
org.eclipse.ui.handlers
org.eclipse.ui.menus

I have listed the dependency hierarchy and javax.xml.bind is not listed.

How can I add the dependencies or clear the errors?

user5756014
  • 301
  • 4
  • 16
Goose
  • 802
  • 1
  • 10
  • 22
  • If using Java 9, see https://stackoverflow.com/a/47795587/6505250 and https://stackoverflow.com/a/46862075/6505250 – howlger Dec 18 '17 at 14:32
  • @howlger. I have checked but both the project and eclipse itself are configured for Java 8. Thanks anyway. – Goose Dec 19 '17 at 08:40
  • The question is, do you use a Java 9 JRE/JDK to run it (see _JRE_ tab in the launch configuration)? – howlger Dec 19 '17 at 09:12
  • No. It is set to run with Java 8. It does export and work fine so it might not be related to my specific project. This is my first attempt at a plug-in. – Goose Dec 19 '17 at 12:25
  • I see. So the issue is that these two packages are missing in your target platform. Does adding the `javax.xml.bind` plug-in to your target platform fix your problem? You can download the plug-in from Eclipse Orbit, e. g. http://download.eclipse.org/tools/orbit/downloads/drops/R20170919201930/ – howlger Dec 19 '17 at 13:00
  • That fixed it. Thank you very much. If you want to post it as a an answer I will accept it as a solution. – Goose Jan 02 '18 at 11:15

1 Answers1

4

It seems, these two packages (java.xml.bind and java.xml.bind.annotation) are missing in your target platform.

Adding the javax.xml.bind plug-in (which can be download from Eclipse Orbit, e. g. here) to your target platform should fix the problem.

howlger
  • 31,050
  • 11
  • 59
  • 99
  • @PéturIngiEgilsson Does in your case the pop-up shows exactly the same message? If not, please ask a separate question with information about the Eclipse and Java version you are using for your product. If you still use Oxygen, please upgrade. – howlger Nov 02 '18 at 07:34
  • 1
    I added javax.xml.stream from https://download.eclipse.org/tools/orbit/downloads/drops/R20190827152740/repository , that solved my problem. – Pétur Ingi Egilsson Sep 29 '19 at 07:12