Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problems with JDK 14
Problems with JDK 14 [message #1830185] Mon, 20 July 2020 08:22 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1784
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi
I'm experimenting with Xtext, JDK 14 and Tycho (1.7.0).
When building with Tycho I get strange compilation errors like

appendable.append(";");
 	           ^^^^^^
The method append(JvmType) in the type ITreeAppendable is not applicable for the arguments (String)
...
.collect(Collectors.joining(", ")));
	                    ^^^^^^^
The method joining(CharSequence) in the type Collectors is not applicable for the arguments (String)


I don't understand where the problem is, so I was wondering if that might be related to JDT used by Xtext?
I have no compilation problem in Eclipse...

thanks in advance
Lorenzo


Re: Problems with JDK 14 [message #1830196 is a reply to message #1830185] Mon, 20 July 2020 10:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14067
Registered: July 2009
Senior Member
Hi, which Xtext version do you use? Can you try with the latest milestone


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problems with JDK 14 [message #1830202 is a reply to message #1830196] Mon, 20 July 2020 11:57 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1784
Registered: July 2009
Location: Firenze, Italy
Senior Member
I'm using Xtext 2.22.0.
I'll try with the latest milestone as well


Re: Problems with JDK 14 [message #1835804 is a reply to message #1830196] Sun, 13 December 2020 17:47 Go to previous messageGo to next message
Jakob Strafer is currently offline Jakob StraferFriend
Messages: 3
Registered: December 2020
Junior Member
Hello,

I am currently experiencing a similar behavior. For the build I am using Tycho 2.1.0 and OpenJDK 15.0.1 but no Xtext.

The example:
	public static void main(String[] args) {
		List<String> words = List.of("foo", "bar");
		CharSequence delimiter = ", ";
		String allWords = words.stream().collect(Collectors.joining(delimiter));
		System.out.println("result: " + allWords);
	}

gives the following error:
[ERROR]         CharSequence delimiter = ", ";
[ERROR]                                  ^^^^
[ERROR] Type mismatch: cannot convert from String to CharSequence


Neither with Eclipse (2020-12) nor with plain javac there is this error. Therefore, I'd assume this to be an issue of Tycho or the JDT-compiler used by it.

Thanks in advance
Jakob
Re: Problems with JDK 14 [message #1835822 is a reply to message #1835804] Mon, 14 December 2020 11:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7267
Registered: July 2009
Senior Member
Hi

I think I have just cracked this bug. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=569379

If you have a < 9 BREE you may need to specify

<deriveReleaseCompilerArgumentFromTargetLevel>false</deriveReleaseCompilerArgumentFromTargetLevel>

and if you have inconsistent org.eclipse.jdt.core.prefs the values passed to ECJ may be inconsistent. Woarkaround; make sure all your org.eclipse.jdt.core.prefs are the same; a good practice anyway.

Regards

Ed Willink
Re: Problems with JDK 14 [message #1835837 is a reply to message #1835822] Mon, 14 December 2020 16:24 Go to previous messageGo to next message
Jakob Strafer is currently offline Jakob StraferFriend
Messages: 3
Registered: December 2020
Junior Member
Hello Ed,

thank you very much for the hint with
<deriveReleaseCompilerArgumentFromTargetLevel>false</deriveReleaseCompilerArgumentFromTargetLevel>

this seems to fix this issue for the moment.

Nevertheless, I've created a small example project (attached zip) in which your solution is commented out. The execution environment is set to JavaSE-11.

The project can be built with OpenJDK 11 without any problems, but fails with later versions (tested it with OpenJDK 15.0.1).

Best regards,
Jakob
Re: Problems with JDK 14 [message #1835839 is a reply to message #1835837] Mon, 14 December 2020 18:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7267
Registered: July 2009
Senior Member
Hi

Please attach your repro to the existing / a new Bugzilla where the developers may see it.

Regards

Ed Willink
Re: Problems with JDK 14 [message #1835842 is a reply to message #1835839] Mon, 14 December 2020 19:13 Go to previous message
Jakob Strafer is currently offline Jakob StraferFriend
Messages: 3
Registered: December 2020
Junior Member
Hi,

I just opened a new bug at
https://bugs.eclipse.org/bugs/show_bug.cgi?id=569710

Best regards,
Jakob
Previous Topic:use generated classes in DSL file, problem of missing type
Next Topic:How to find the cross-references of an Eobject across files?
Goto Forum:
  


Current Time: Mon Sep 27 02:03:00 GMT 2021

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

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

Back to the top