Java version keeps getting reset to 1.5 when I change something (libraries in Project Settings?)
Answered
Something is changing Java versions on me - from my selected 1.8 to 1.5. I need to fix this in two places
- Project Settings -> Modules -> Sources and set language level
- .idea/compiler.xml: change <module name="DroolsGameEngine" target="1.5" /> to 1.8
I think this is when I modify libraries via Project Settings. Whatever the cause, I would like to be able to change this default 1.5 to 1.8, but I don't know where to look to achieve this. Any pointers most welcome.
Thanks,
Please sign in to leave a comment.
Please share a sample project https://uploads.services.jetbrains.com/ and the screenshot from the project structure | modules dialog showing the language level selected for the module.
I am also having this problem:
pom.xml:
Please report at https://youtrack.jetbrains.com/newIssue?project=IDEA and proivde a small sample project to reproduce the issue.
I had to use older version 2017.#.# becase of the project , and Intellij is giving me nightmares. unbelievable that Intellij assumes compiler is 1.5 [in modules]. Is it not very much fundamental. once this is done...all spring code becomes red. Hate this editor.
>Intellij assumes compiler is 1.5
Maven defaults to 1.5 version unless you explicitly set it in pom.xml. Please see https://stackoverflow.com/a/12900859/2000323
I had to change - Project Structure -> Modules -> Sources and set language level
even after maven source and target java version were added as 1.8 to properties in pom. Anyways it is community edition, so presume there will lots of issues. sometimes - %MODULE_WORKING_DIRECTORY% issue, as if it doesn't know what it looks for.
Community and Ultimate editions have equal Maven support except for Maven dependency diagrams.
>I had to change - Project Structure -> Modules -> Sources and set language level even after maven source and target java version were added as 1.8 to properties in pom.
If you have this issue with the latest version please report at https://youtrack.jetbrains.com/issues/IDEA with the same project configuration. We will investigate. Thanks.
>sometimes - %MODULE_WORKING_DIRECTORY% issue, as if it doesn't know what it looks for.
There is no such macro path as %MODULE_WORKING_DIRECTORY%. There are %MODULE_WORKING_DIR% (has been added since 2018.2) and $MODULE_DIR$. Please see this comment for more info.
I just had this problem, fixed it by deleting the project and reimporting from vcs. Version 2021.1.3