Skip to main content



      Home
Home » Newcomers » Newcomers » Type Inference with Eclipse(JEP 286: Local-Variable Type Inference with Eclipse 4.7.3 (Oxygen 3))
Type Inference with Eclipse [message #1784146] Thu, 22 March 2018 17:51 Go to next message
Eclipse UserFriend
I updated my Eclipse how you tell us. But it dosen´t work.
The reserved type name var has the color violet and i think eclipse know the new oportunity.
But the Error message is:

var cannot be resolved to a type

why doesn´t work it?

I need youre help.

this is my code sniped:

var list = new ArrayList<String>(); // infers ArrayList<String>
var stream = list.stream(); // infers Stream<String>

// int
var zahl = 5;
// String
var string = "Hello World";
// BigDecimal
var objekt = BigDecimal.ONE;

Re: Type Inference with Eclipse [message #1784171 is a reply to message #1784146] Fri, 23 March 2018 04:23 Go to previous messageGo to next message
Eclipse UserFriend
You installed this? https://marketplace.eclipse.org/content/java-10-support-oxygen
Re: Type Inference with Eclipse [message #1784222 is a reply to message #1784171] Fri, 23 March 2018 13:27 Go to previous messageGo to next message
Eclipse UserFriend
Yes. I have it installed as described in the Eclipse newsletter link.
4.7.3-build 20180322-1830
Re: Type Inference with Eclipse [message #1784223 is a reply to message #1784171] Fri, 23 March 2018 13:48 Go to previous messageGo to next message
Eclipse UserFriend
Sorry ... i post it too fast ...
After updating the version no. is still 4.7.3 and not 4.7.3a!
Before updateing Eclipse leav the color of var black
After updating Eclipse change automatically the color of var to violet.

Re: Type Inference with Eclipse [message #1784238 is a reply to message #1784223] Sat, 24 March 2018 04:50 Go to previous message
Eclipse UserFriend
So it's working now? You might need to set JDT preferences to Java 10, perhaps even have a Java 10 JDK configured, though I'm not sure about that....
Previous Topic:Easiest way to build Eclipse IDE (JAVA) on my local PC
Next Topic:Plugins re-installation on any platform restart
Goto Forum:
  


Current Time: Sat Jul 19 08:51:21 EDT 2025

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

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

Back to the top