Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 21:51 Go to next message
Manuel Prochnow is currently offline Manuel ProchnowFriend
Messages: 4
Registered: March 2018
Junior Member
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 08:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29349
Registered: July 2009
Senior Member
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 17:27 Go to previous messageGo to next message
Manuel Prochnow is currently offline Manuel ProchnowFriend
Messages: 4
Registered: March 2018
Junior Member
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 17:48 Go to previous messageGo to next message
Manuel Prochnow is currently offline Manuel ProchnowFriend
Messages: 4
Registered: March 2018
Junior Member
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 08:50 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29349
Registered: July 2009
Senior Member
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: Sun May 20 19:50:01 GMT 2018

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

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

Back to the top