How to set eclipse with JRE 8?
Asked Answered
F

3

1

I tried to update my jre version in eclipse, I added the jre 8 to my installed JRE's an checked him. When I click OK it gives me an ERROR:

The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from 
required .class files

It happens only when I am trying to use JRE 8.

Someone know how to fix this?

I use Indigo Eclipse. Version: Service Release 2.

Foresight answered 18/4, 2014 at 8:54 Comment(3)
Which eclipse version are you using?Flimflam
Version: Indigo Service Release 2Foresight
If you are not really bound to this version, download a java 8 enabled eclipse Keplar. This is working for me - but it's still a bit buggy.Flimflam
D
0

Create new workspace. Create new java project and select jvm8 as jvm. Changing the vm in an existing project is quite difficult and cached class file compiled with the previous vm can generate some strange unpredictable behavior

Disposable answered 18/4, 2014 at 9:7 Comment(2)
Is there a way to update my existing (android) project?Foresight
You can try to change the runtime, but in my opinion is easier create a new project and copy the source from old project to the new project.Disposable
S
1

The problem is rt.jar in the JVM 8.0.

java.lang.CharSequence is a class under rt.jar. rt.jar under JVM 7.0 has no problem, but rt.jar under JVM 8.0 has a problem with Eclipse Indigo. Solition is downloading Eclipse Kepler, JVM 8.0 with Kepler has no problem.

Supposing answered 25/4, 2014 at 13:48 Comment(0)
D
0

Create new workspace. Create new java project and select jvm8 as jvm. Changing the vm in an existing project is quite difficult and cached class file compiled with the previous vm can generate some strange unpredictable behavior

Disposable answered 18/4, 2014 at 9:7 Comment(2)
Is there a way to update my existing (android) project?Foresight
You can try to change the runtime, but in my opinion is easier create a new project and copy the source from old project to the new project.Disposable
P
0

You need Eclipse Kepler (4.3) Service Release 2. After startup you need to install a patch that enables using Java 8 in eclipse from this update site (Help -> install new Software... -> use site):

http://download.eclipse.org/eclipse/updates/4.3-P-builds/

But a Android Project will not benefit from Java 8 because it still uses Java 6 and you cannot use Lambda Expressions or even the diamond Operator from Java 7.

Pashalik answered 18/4, 2014 at 9:32 Comment(2)
I use Indigo eclipse, It will work also with indigo? Thank you for you replaying.Foresight
No, Java 8 in Eclipse is only supported by Kepler (4.3.2) AND with the extra patch described in my post. No Indigo, to other versions.Pashalik

© 2022 - 2024 — McMap. All rights reserved.