I have attempted to fix this problem using the various forums on this site, but nothing has helped. I tried similar techniques as used to fix other people's 1.8 errors, but nothing has worked. I have my java class file under my source folder and no imports, I just simply want a basic output message to make sure intelliJ is working as it should. Can anyone offer any advice?
Asked
Active
Viewed 1.8k times
13
-
where is your code? Please add some code to understand the issue. – atp9 Mar 07 '17 at 14:13
-
1Go to file -> settings -> Build Execution and Deployment -> Java -> Compiler Here change the compiler language level to 1.8 or lesser. – Srikanth Balaji Mar 07 '17 at 14:18
-
Did you check all the options in [this answer](http://stackoverflow.com/a/12900859/104891)? Are you sure it doesn't help? – CrazyCoder Mar 07 '17 at 19:19
2 Answers
31
Here change the language level to 1.8 or lesser. This changes the target release version.
Go to file -> settings -> Build Execution and Deployment -> Java -> Compiler
Here change the language level to 1.8 or lesser. This changes the source release version.
File -> Project Structure -> Module Settings -> Tab: Source: Language Level
and also here,
File -> Project Structure -> Project(In left pane) -> Project language level

neonidian
- 1,221
- 13
- 20

Srikanth Balaji
- 2,638
- 4
- 18
- 31
-
Are you aware that it changes the `target` version, not the `source`? – CrazyCoder Mar 07 '17 at 19:19
-
@CrazyCoder, I have edited the answer - To refer both source and target release version – Srikanth Balaji Mar 08 '17 at 00:17
-
0
Just in case anyone stumbles onto the same problem and the above answer doesn't solve it, my issue was resolved doing the following (I was using Gradle):
- Open the your-project-name.ipr file.
- Verify the following line:
<bytecodeTargetLevel target="1.xx" />
Mine was set to 1.10
. I changed it to 1.08
(which my project SDK was set to) and the problem was solved.

Danny Meyer-Kristensen
- 126
- 2
- 9