22

I've installed the most popular plugin in Eclipse (Spring Tools 4.14.1) and i tried to create a new project and open the pom.xml and then it shows error and comes like

Failed to create the part's controls

The error shows like this. Why does this happen? How to fix it?

java.lang.NoClassDefFoundError: org/eclipse/tm4e/ui/utils/ContentTypeHelper
    at org.eclipse.tm4e.languageconfiguration.LanguageConfigurationCharacterPairMatcher.findContentTypes(LanguageConfigurationCharacterPairMatcher.java:134)
    at org.eclipse.tm4e.languageconfiguration.LanguageConfigurationCharacterPairMatcher.getMatcher(LanguageConfigurationCharacterPairMatcher.java:113)
    at org.eclipse.tm4e.languageconfiguration.LanguageConfigurationCharacterPairMatcher.match(LanguageConfigurationCharacterPairMatcher.java:47)
    at org.eclipse.jface.text.source.MatchingCharacterPainter.paint(MatchingCharacterPainter.java:313)
    at org.eclipse.jface.text.PaintManager.addPainter(PaintManager.java:207)
    ...
howlger
  • 31,050
  • 11
  • 59
  • 99
atialus.so
  • 221
  • 1
  • 2
  • 4
  • 9
    Does installing [Eclipse tm4e](https://github.com/eclipse/tm4e/) via _Help > Install New Software..._ working with the update site [`http://download.eclipse.org/tm4e/snapshots/`](http://download.eclipse.org/tm4e/snapshots/) fix your issue? – howlger Apr 28 '22 at 11:46
  • Yes, it does! So the pom.xml editing relys on a part that a regular install of Eclipse may not really cover. Many thanks! :) – atialus.so Apr 28 '22 at 14:07
  • Maybe Spring Tools 4.14.1 misses explicit requiring of tm4e, which is included in the _Eclipse IDE for Enterprise Java and Web Developers_ but not in the _Eclipse IDE for Java Developers_ (which I guess you have, right?). So please makes sure it has been reported here: https://github.com/spring-projects/sts4/issues – howlger Apr 28 '22 at 15:26
  • Or maybe it's an issue of [m2e](https://github.com/eclipse-m2e/m2e-core). Into which Eclipse IDE package and Eclipse version with which m2e version did you install Spring Tools 4.14.1? – howlger Apr 28 '22 at 15:39
  • Yes i did. My install is actually in Enterprise Java version, and it didn't include tm4e. – atialus.so Apr 29 '22 at 00:09
  • Then it must have been an older Eclipse version and when Spring Tools 4.14.1 was installed, Maven support m2e was also updated. m2e uses tm4e for XML syntax highlighting, but in the past m2e used [WTP](https://projects.eclipse.org/projects/webtools.sourceediting) instead. – howlger Apr 29 '22 at 06:04

2 Answers2

41

Spring Tools 4.14.1 is missing tm4e.

To install it, go to "Help → Install new software → Add URL: https://download.eclipse.org/tm4e/snapshots/. Click finish. Restart Eclipse.

Thanks to howlger for ideas from the question comments.

Sk8erPeter
  • 6,899
  • 9
  • 48
  • 67
Garikina Rajesh
  • 409
  • 3
  • 5
  • 4
    Thanks! This worked for me using: https://download.eclipse.org/tm4e/releases/latest/ – Darren Parker May 19 '22 at 14:34
  • 3
    Need select only the "TextMate Core" component. – danieltc07 May 29 '22 at 21:45
  • The answer was right, however, it seems like this should have been mentioned in the Eclipse package management as a dependency. – Woodsman May 31 '22 at 00:03
  • 1
    After installing the releases/latest, my eclipse freezes at startup (with 1MB Ram), just showing the startscreen. It's a Eclipse 2022-06 running with JavaAdopt11. – Alex Jul 26 '22 at 12:16
0

I installed Dockerfile support files for eclipse and then I faced this issue where I'm unable to open my pom.xml file and got the exact error which OP has posted, then I followed what Mr. Howlger advised and installed the software from below link and now I'm able to resolve the issue.

http://download.eclipse.org/tm4e/snapshots/

Suresh
  • 1,491
  • 2
  • 22
  • 27