My eclipse reported the warning that "The compiler compliance specified is 1.6 but a JRE 1.8 is used".
I have built my HelloWorld Android application using Java1.8, however, I got that warning and I cannot build up my project. I have tried to set the compiler compliance to java1.8. But I got another error that
"Android requires compiler compliance level 5.0 or 6.0. Found '1.8'"
.I don't know how to fix this problem?
Possible solution:
Right-click on your project and select "Android Tools -> Fix Project Properties". (if this doesn't work, try the following option)
Right-click on your project and select "Properties -> Java Compiler", check "Enable project specific settings" and select
1.5 or 1.6 from the "Compiler compliance settings" select box.
Under Window -> Preferences -> Java -> Compiler, set Compiler
compliance level to 1.5 or 1.6.
Go to windows>preference>java>compiler.
Tick the check box "use default compliance setting" then apply and close.
Right-click on the project and go to build path> configure build the path
Under Libraries tab remove JRE System Library and click on add library
select the radio box execution environment and select the environment
Apply nad Close
Following changes need to be done under folder name of your project: -
.settings
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
IDE configuration
I'm working on VSCode and I just made next thing
I changed version in pom.xml to one I installed on computer
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.11</maven.compiler.source>
<maven.compiler.target>1.11</maven.compiler.target>
<java.version>1.11</java.version>
</properties>
Before I had 1.8 and now there is 1.11
I Installed WindowBuilder on Eclipse to create a Graphic User Interface for a program. When I go to the 'Design' tab the following error appears:
Eclipse is running under 1.8, but this Java project has a 10 Java
compliance level, so WindowBuilder will not be able to load classes
from this project. Use a lower level of Java for the project, or run
Eclipse using a newer Java version.
I currently have Installed Java 8 (Update 171), and Oxygen.3a (4.7.3a) (Eclipse Version). I had previously downloaded Java 10, but I read that there's a bug where WindowBuilder doesn't work on that version, and that it is recommened the Version 8, which is the one I downloaded and installed (after uninstalling Version 10). But the problem's still there.
What could I do to solve this? Thank you.
Just change the compliance level of the project from 10 to 1.8, rebuild and the Design tab should work:
To change the project's compliance level:
Select the project's node in Project Explorer, right-click and select Properties.
Select Java Compiler from the column on the left.
Uncheck Use Compliance from execution environment...
Select 1.8 from the drop list for Compiler compliance level. (Presumably its current value is 10.)
Click the Apply and Close button.
Rebuild the project using 1.8 compliance.
The Design tab should work fine now.
As a separate issue, since you have uninstalled Java 10 you should also remove it from your Installed JREs if you haven't done that already:
Windows > Preferences > Java > Installed JREs
Select the entry for JDK 10 and click the Remove button.
If the JDK 10 entry was checked when you removed it you will be forced to check another JRE definition.
Click the Apply and Close button.
WB 1.9.1 has solved the issue:
https://www.eclipse.org/windowbuilder/download.php
Just change the compliance level of the project from the current to 1.8, rebuild and the Design tab should work:
It works for me
I have Eclipse Kepler. I recently deleted my JRE 7 folder and I'm now using the JDK 8. When I create a new project I get a caution sign with something related to compliance level:
What do I need to do to encounter the problem?
Kepler doesn't have 1.8 compliance support, so you have to update to a newer version of Eclipse (like Juno).
When you do, you have to make sure that you have properly pointed the JDK installation directory in Eclipse. You can navigate to Window → Preferences → Java → Installed JREs, add the JDK8 environment (and select it as default, as you don't have any other, since you have deleted 1.7 one).
Then, when you navigate to Window → Preferences → Java → Compiler, you should be able to select 1.8 as "Compliance level", as shown here:
Eclipse Kepler does not support Java 8. You need to move to the current release of Eclipse (Eclipse Mars) for full Java 8 support.
I need to write an essay in computer science using java 1.6 only.
the problem that I have 1.8 installed in my computer.
is there a plugin for eclipse that show me warnings for 1.7 and 1.8 features?
thank you!
You don't need a plugin. You can set the Compliance level of the Eclipse Java compiler in the Preferences in 'Java > Compiler' (which sets the default for the whole workspace). You can also set the level in the Properties for a Project ('Java Compiler') properties.
Setting the compliance level to 1.6 will give you errors for 1.7 and 1.8 language features. However it will not warn you if you use classes and methods from the Java API which are not in 1.6 - only installing a 1.6 JDK can do that.
You can also tell Eclipse about multiple Java JRE/JDK installs in the Preferences in 'Java > Installed JREs' and then choose which one to use in each project.
Did anybody have similar problem with this, I import android project and I get
errors like
[2011-10-03 17:20:09 - Screen] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
[2011-10-03 17:21:55 - App] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
[2011-10-03 17:21:59 - App] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
I got errors to delete all #Override above functions. I have Windows 7 x64, jvm7 x64. Does anyone have clue what is wrong ?( I done Android Tools -> Fix Project Properties but didn;t help )
That isn't the problem, Jack. Android SDK isn't x64, but works ok with x64 jvm (and x64 eclipse IDE).
As helios said, you must set project compatibility to Java 5.0 or Java 6.0.
To do that, 2 options:
Right-click on your project and select "Android Tools -> Fix
Project Properties" (if this din't work, try second option)
Right-click on your project and select "Properties -> Java
Compiler", check "Enable project specific settings" and select
1.5 or 1.6 from "Compiler compliance settings" select box.
Go to the project folder and right click on it -> properties -> check off the read only box and click ok
Right-click on your project and select "Android Tools -> Fix Project Properties"
Right-click on your project and select "Properties -> Java Compiler", check "Enable project specific settings" and select 1.5 or 1.6 from "Compiler compliance settings" select box. (try all the levels one by one just in case)
Under Window -> Preferences -> Java -> Compiler, set Compiler compliance level to 1.6 or 1.5.
Hopefully it will settle the problem.
I would recommend using x86 version of jvm. When I first got my new laptop (x64), I wanted to go x64 all the way (jvm, jdk, jre, eclipse, etc..). But once I finished setting everything up I realized that the Android SDK wasn't x64, so I had issues. Go back to x86 jvm and you should be ok.
EDIT: 11/14/13
I've seen some recent activity and figured I would elaborate a little more.
I did not say it would not work with x64, I just recommended using x86.
Here is a good post on the advantages / disadvantages of x64 JDK. Benefits of 64bit Java platform
Thought process: To what end? Why am I trying to using 64 bit JDK? Just because I have a 64-bit OS? Do I need any of the features of 64-bit JDK? Are there any extra features in the 64-bit JDK?! Why won't this s*** play nice together!? F*** it I'm going 32-bit.
Doing Project -> Clean... fixed it for me.
My eclipse had stopped working so I cleaned workspace directory and after I run eclipse when I import the project I had this problem. Other solutions suggested here didn't work.
For most of the people still receiving the error after fixing project properties, you probably installed Java 7 SDK when setting up your environment, but it is not currently supported for Android development.
As the error message sais, you should have installed Java 5.0 or 6.0, but Java 7 was found.
If you fix project properties without first installing Java 5 or 6, you will see the same error again.
So first, ensure you have Java SDK 5 or 6 installed, or install it.
Check your environment variable (JAVA_HOME) is pointing to SDK 5/6.
And then:
Check that Eclipse is using SDK 5/6 by default (Window => Prefs. => Java => Compiler
Disable Project Specific Settings (Project Properties => Java Compiler)
Fix Project Properties
OR
Leave Eclipse using JDK 7 by default.
Enable Project Specific Settings (Project Properties => Java Compiler)
Select Compiler Compliance 1.5 or 1.6 (Project Properties => Java Compiler)
I agree with BMSAndroidDroid and Flo-Scheild-Bobby. I was doing a tutorial called DailyQuote and had used the Cordova library. I then changed my OS from Windows to Ubuntu and tried to import projects into Eclipse, (I'm using Eclipse Juno 64-bit, on Ubuntu 12.04 64-bit, Oracle JDK 7. I also installed the Ubuntu 32-bit libs- so no issues with 64 and 32bit), and got the same issue.
As suggested by Flo-Scheild-Bobby, open configure build path and add the jar(s) again that you added before. Then remove the old jar link(s) and thats it.
I fixed this problem employing the two procedures of :
In Eclipse->'Project' menu -> 'Java Compiler' -> set 'Compiler compliance level' = 1.6
check on 'Use default compliance settings'
Set 'Generated .class compatibility' = 1.6
Set 'Source compatibilty' = 1.6
Then go to 'Windows' menu --> 'Preferences' -->'Java' , expand 'Java' --> 'Compiler' -->Set 'Compiler compliance level' = 1.6
Hint: Source compatibility must be equal to or less than compliance level.
I would suggest that u check for the jar files are properly included in your projects. There are possibility that in absence of jar files, the project will not be compiled
As BMSAndroidDroid said, this problem may be caused by a wrong build path configuration.
If you included some libraries to your build path, then move the libraries, the build path will conserve the wrong references, will not found the libraries during compilation and you will get an error.
To fix it, right click on your project folder > build path > configure build path
Then take a look to the library tab, and remove the old libraries.
In my case a switch from openjdk7 to openjdk6 helped. Afterwards I changed the compliance level to 1.6 and all compiled fine.
i come across this problem cause my debug.keystore is expired, so i deleted the debug.keystore under .android folder, and the eclipse will regenerate a new debug.keystore, then i fixed th
Following worked for me
Enable project-specific settings and set the compliance level to 1.6
How can you do that?
In your Eclipse Package Explorer 3rd click on your project and select properties. Properties Window will open. Select Java Compiler on the left panel of the window. Now Enable project specific settings and set the Complier compliance level to 1.6. Select Apply and then OK.