Adding JFace/SWT to en existing application - unresolved SWT error

已回答

I'm trying to add JFace/SWT to an application I'm building.

I prefer this approach to JavaFX due to the native look and feel of the Eclipse widgets.

I add the JFace library via the Maven search making my dependency: eclipse.platform.jface

It creates the eclipse_platform_jface.xml :

``` <component name="libraryTable">  
     <library name="eclipse.platform.jface" type="repository">  
       <properties maven-id="org.eclipse.platform:org.eclipse.jface:3.34.0" />  
       <CLASSES>  
         <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/platform/org.eclipse.jface/3.34.0/org.eclipse.jface-3.34.0.jar!/" />  
         <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/platform/org.eclipse.swt/3.126.0/org.eclipse.swt-3.126.0.jar!/" />  
         <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/platform/org.eclipse.core.commands/3.12.100/org.eclipse.core.commands-3.12.100.jar!/" />  
         <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/platform/org.eclipse.equinox.common/3.19.100/org.eclipse.equinox.common-3.19.100.jar!/" />  
         <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/platform/org.eclipse.osgi/3.20.0/org.eclipse.osgi-3.20.0.jar!/" />  
       </CLASSES>  
       <JAVADOC>  
         <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/platform/org.eclipse.jface/3.34.0/org.eclipse.jface-3.34.0-javadoc.jar!/" />  
         <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/platform/org.eclipse.swt/3.126.0/org.eclipse.swt-3.126.0-javadoc.jar!/" />  
         <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/platform/org.eclipse.core.commands/3.12.100/org.eclipse.core.commands-3.12.100-javadoc.jar!/" />  
         <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/platform/org.eclipse.equinox.common/3.19.100/org.eclipse.equinox.common-3.19.100-javadoc.jar!/" />  
         <root url="jar://$MAVEN_REPOSITORY$/org/eclipse/platform/org.eclipse.osgi/3.20.0/org.eclipse.osgi-3.20.0-javadoc.jar!/" />  
       </JAVADOC>  
       <SOURCES />  
     </library>  
   </component>
```

This includes a dependency for org.eclipse.swt. Yet when I start to build the application it clearly feels that swt is missing as evidenced by syntax errors on Shell and anything else from SWT.

In addition when I dive into the decompiled code, I see a similar problem in that the decompiler can't find the declaration for shell.

What have I missed in coaxing Intellij to do my bidding? 

0

Hello, Mark!

Thank you for reporting this!

Could you please clarify how exactly you are adding the Library (IDEA allows multiple ways to do it) and which Build System does your Project use (IDEA Native, Maven, Gradle)?
Would it be possible to share the Project itself?

0

请先登录再写评论。