Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem with isJavaEnabled()
Problem with isJavaEnabled() [message #1490775] Fri, 28 November 2014 12:34 Go to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
The Geppetto product is built on Xtext but it does not include JDT. Geppetto may also be installed into an Eclipse IDE but unless Xtext is already installed there it won't work very well. Here's why:

The product includes a feature where the following is included:

  1. The Eclipse platform
  2. The Xtext plug-ins needed by Geppetto
  3. The Geppetto feature

The problem is that when we don't use the product but instead installs the feature #3 into an Eclipse IDE, then Xtext detects that java is enabled. This in turn results in that the SharedContributionWithJDT will make an attempt to bind the class JdtQueuedBuildData which in turn references JavaBuilderState which we neither provide nor depend on. Consequently it has not been installed by p2.

In short, when 'isJavaEnabled()' returns true the xtext requirements change. Bundles marked as optional become required and our bundles fail to start. I don't know what the best solution is for this and any advice would be welcome:

  • We can tell our users that in order to install Geppetto into an IDE, they need to install additional Xtext features first because the IDE has the JDK installed and that in turn increases the requirements from Xtext beyond what our feature actually requires.
  • We can provide an additional feature that includes the xtext bundles that are no longer optional when the JDK is present and tell users that they need to install that too.

None of the above strikes me as an ideal solution. I think we would need a way to influence the SharedContributionWithJDT module and prevent it from binding even when java is enabled.
Re: Problem with isJavaEnabled() [message #1495613 is a reply to message #1490775] Tue, 02 December 2014 11:04 Go to previous messageGo to next message
Matthieu Wipliez is currently offline Matthieu WipliezFriend
Messages: 30
Registered: March 2010
Member
Yippee it seems that I'm not alone after all in using Xtext but not JDT! Thank you Thomas!

See also this thread for additional information on optional dependencies and Xtext's ambiguous relationship with JDT Smile : https://www.eclipse.org/forums/index.php/t/629003/

I would also like to see a better solution than the current requirement on JDT.
In the meantime, what build system are you using to build your product? If you're using Maven, you can filter out any unwanted bundles in your product's pom.xml as follows:

<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>target-platform-configuration</artifactId>
  <version>${tycho-version}</version>
  <configuration>
    <!-- ignore optional dependencies in the product -->
    <dependency-resolution>
      <optionalDependencies>ignore</optionalDependencies>
    </dependency-resolution>

    <!-- filter out unwanted bundles -->
    <filters>
      <filter><type>eclipse-plugin</type><id>org.eclipse.jdt.core</id><removeAll/></filter>
      <!-- any other plugins that you want to ignore here -->
    </filters>
  </configuration>
</plugin>

Your product must not include the Xtext feature for that to work (otherwise the build will fail because JDT is unavailable but required)

Note: this only works for a full product build, if your users want to install into an existing Eclipse installation, or update, then Eclipse will still install JDT at the same time Sad

Please dear Xtext developers, hear our prayers!
Re: Problem with isJavaEnabled() [message #1495647 is a reply to message #1495613] Tue, 02 December 2014 11:38 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi Matthieu,

Thanks for the info about filtering optional plug-ins. We're using Buckminster for the builds and optional plug-ins isn't a problem for us. The problem occurs when we omit optional plug-ins that then become required at runtime when the JDT is detected.

Our current solution is to provide two features. One that is slimmed down to a bare minimum intended for the product where no JDT is present and another for installation in the Eclipse IDE. The latter requires the org.eclipse.xtext.ui feature which in turn ensures that all optional stuff is brought in.
Re: Problem with isJavaEnabled() [message #1497426 is a reply to message #1495647] Wed, 03 December 2014 20:27 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Thomas,

that solution is usually the best you could provide. Could you please
share a list of bundles that should be available, too, when
#isJavaEnabled may return true as a valid answer?

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Previous Topic:simple maven build
Next Topic:Elegant way of determining which terminal was matched?
Goto Forum:
  


Current Time: Thu May 09 09:10:47 GMT 2024

Powered by FUDForum. Page generated in 0.03240 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top