In this article, we will discuss Java compiler compliance level issue in Eclipse IDE
1. Java compiler compliance level issue
- Sometimes, when we work on Eclipse IDE then there is possibly that we might get compiler compliance level issue
- Reason: this is because of difference in installed JRE which is used for compilation and compiler compliance level set for respective project
- Let us see one issue with screen-capture from Eclipse IDE
In the above example,
- We have used generics which is introduced in Java 1.5 version
- Also, installed JRE for this project is set to Java 1.6 version
- But still compile-time error is thrown stating “Change project compliance and JRE to 1.5”
- Solution: go to Project Properties and check Java Compiler compliance level
- If it is set to a lower version, then change it to a required version and compile again
2. Path to go to Project Properties:
- Right click on Project –> click Properties –> Java Compiler –> Change Compiler compliance level to required level
- For example, Java 1.6 version for this case to work
- Select 1.6 version from drop-down list and click Apply
- When Apply is clicked, then dialog box will appear with message/information “The compiler settings have changed. A rebuild of the project is required for changes to take effect. Build the project now?“
- Click Yes and finally OK
All issues related to compiler compliance level will be resolved now
3. Useful Eclipse IDE shortcuts :
- Eclipse IDE – How to show line numbers ?
- Eclipse IDE – How to GO TO any line number directly ?
- Eclipse IDE – How to remove unused imports ?
- Eclipse IDE – How to clean project ?
- Eclipse IDE – How to build Java project automatically ?
- Eclipse IDE – How to comment and un-comment line & block ?
- Eclipse IDE – How to generate constructor using fields ?
- Eclipse IDE – How to generate getters and setters ?
- Eclipse IDE – How to search files ?
- Eclipse IDE – How to locate methods in Java file ?
- Eclipse IDE – How to open editor using CTRL + E ?
- Eclipse IDE – Java compiler compliance level issue
Related Articles:
- Apache Maven – Introduction
- Apache Maven – Install on Windows 7 OS
- Apache Maven – Settings.xml explanation
- Apache Maven – Proxy setting explanation
- Apache Maven – pom.xml explanation
- Apache Maven – Plugins explanation
- Apache Maven – Changing default Maven repository location in Windows 7 OS
- Apache Maven – Local, Central and Remote Repositories
- Apache Maven – Installing custom library into local repository
- Apache Maven – Transitive dependencies explanation
- Apache Maven – Exclusion of Transitive dependencies
- Apache Maven – Dependency Scopes
- Apache Maven – Skipping unit test using surefire plugin
- Apache Maven – Exclusions and Inclusions of unit test
- Apache Maven – offline execution
- Apache Maven – Co-ordinates explained
- Eclipse + Maven – Integration
- Eclipse + Maven – How to import Maven project with pom.xml ?
- Eclipse + Maven – Setting M2_REPO classpath variable in IDE
- Eclipse + Maven – M2_REPO is Non Modifiable
- Eclipse + Maven – Creating and exploring projects using archetypes
- Eclipse + Maven – Converting Web project to Maven project
- Eclipse + Maven – mvn eclipse:eclipse command
- Eclipse + Maven – Plugin execution not covered by lifecycle configuration
Happy Coding !!
Happy Learning !!