Reputation: 141
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?
Upvotes: 14
Views: 92672
Reputation: 93
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
.
Upvotes: 3
Reputation: 51
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
Upvotes: 0
Reputation: 1
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
Upvotes: 0
Reputation: 13747
Possible solution:
"Android Tools -> Fix Project Properties"
. (if this doesn't work, try the following option)"Properties -> Java Compiler"
, check "Enable project specific settings" and select
1.5 or 1.6 from the "Compiler compliance settings" select box.Window -> Preferences -> Java -> Compiler
, set Compiler
compliance level to 1.5 or 1.6.Upvotes: 20