5

jdk-11, Eclipse Photon 18-9, windows 7, Error free Application ported from java 6 until java 8. Just trying how far jdk-11 is usable with Eclipse.
JAVA_HOME points to jdk-11. Eclipse starts! But then things go strange. It’s possible to set the Java Build Path to jdk-11. But even if forced to be under Classpath the jre changes self to Modulepath! The compiler compliance level can be set up to Java 10! Under project Facets the highest Version of java which can be chosen is 9! If the compliance level of java is not reduced to 9, Java version mismatch is signaled! Building with eclipse generates the mentioned false Error in 100 of cases! However compiling with maven, source and target set to java 11, the package build terminates with success even if compiling for jee 8. Who knows more about that? Anyway I’ll switch back to Java 8. Conclusion after a year of new Java versions coming out, it’s still not possible to use them! Very strange.

Till Brychcy
  • 2,876
  • 1
  • 18
  • 28
juerg
  • 381
  • 4
  • 18
  • 1
    There is no Eclipse _Photon 18-9_. Probably, you mean Eclipse 2018-09 (4.9). If you want to write Java 11 code, you have to install [this plug-in](https://marketplace.eclipse.org/content/java-11-support-eclipse-2018-09-49) or wait until Eclipse 2018-12 (4.10). – howlger Sep 28 '18 at 16:53
  • Aha! So I'm right and it's still too early to let java 8 behind. Oracle anounced "end of public updates" of JDK 8 for January 2019, but the tools have not yet catched up! Please allow me to worry about! – juerg Oct 01 '18 at 15:10
  • Eclipse 2018-09 has been released before Java 11 and Eclipse has never supported future frameworks or Java releases. If Eclipse were a commercial product, the Java 11 plug-in would probably be shipped already for marketing reasons, even if it contains some minor bugs. From my point of view, a switch to Java 11 is not too early, only with the switch to modules (JPMS) I would still wait if at all. – howlger Oct 01 '18 at 15:30
  • Thanks for the explanation. I'll consider it. W.r.t. JPMS I tried it immediatly when Java 9 was out and I found a lot of incompatibilites with what we have realized before as modules in our own manner. So we wait and stick to what we have working well. :)) – juerg Oct 03 '18 at 07:59

3 Answers3

6

I just encountered this same issue, what i did to fix it was i just cut out that segment of code and pasted it back in and then it worked like it was supposed to. It can be caused by a small bug in the compiler. It stumped me for about an hour, but I got it! Otherwise, if you right click the project folder and go to properties, then compiler, you can change the compliance level to 11. this prevented the error from appearing a second time.

Isaiah
  • 61
  • 1
  • 4
0

I was able to fix the issue by explicitly importing the hidden type:

import java.lang.Integer;

Note: before that I tried with

> Menu > Project > Clean

which seemed to work. That fix was only temporary however.

Soundbytes
  • 1,149
  • 9
  • 17
0

I had the same problem in Eclipse. However, the only thing that fixed it was changing the JRE from 10 to 11. So yes, it was a compatibility issue. I tried "Java.Lang.Integer" but like mentioned before, it was only temporary (which made NO sense to me since we are dealing with a type "String" lol). Screenshot Screenshot

Dharman
  • 30,962
  • 25
  • 85
  • 135
Eva
  • 1
  • 1