Java 8 doesn't compile on Intellij15 - intellij-idea

Recently our company moved to Java 8 (previously working with Java 7).
Everything was fine while I was using Eclipse, but now I switched to IntelliJ Idea 15 (it's my first time in IntelliJ Idea) and it simply won't compile any Java 8 code (lambdas, etc.)
I searched for a solution and found out that I have to set a project language level to 8 in IntelliJ project settings, but it still doesn't help.
Any ideas?

Make sure that you correctly selected the JDK.
In IntelliJ you should go to: File -> Project Structure... project settings tab, and make sure the project SDK points to the location of your java 8 JDK, (something like: C:\Program Files\java\jdk1.8.0_45)
And, of course, make sure the project language level is set to 8 - Lambdas, type annotations etc.

Related

inteliJ IDEA don't store the project informations

Every time I create a new project in InteliJ it creates only a iml file, and I cannot see my file and libraries. But after I close the project and make the same project by override, it works.
I suspect it's something from the settings, but I don't know where.
I use IntelliJ IDEA 2021.3 (Community Edition)
Build #IC-213.5744.223, built on November 27, 2021
Runtime version: 11.0.13+7-b1751.19 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 7 6.1
PS: I am looking for a more permanent solution, as it gets fustrating..
Well, it seems that it has a small bug.
When I make a new project, I have 2 ways of creating in:
by choosing a name in the Project name field, and then obtional choose the path manually if required. This works very well.
by skip the first field and live untitled as it is, and choose the path in the Project location field, creating a new folder, and then when you came back the Project name field is with the name of the folder, but when I click finish, I can not see modules, compiler settings and SDK selected. (see the picture from the question)

intellij doesn't recognize jvm when I try to configure jdk

I'm working on mint-cinnamon as my file-system and running intellij on it,
I'm trying to add jdk to intellij but when i'm looking for it trough intellij it doesn't show any jdk nor jvm file though I know that these files exist (open jdk 8 and open jdk 11 and jvm) and I know where they are.
I've tried reinstall jdk11 and 8, rebuild the project, and download lib32.
enter image description here
enter image description here, enter image description here
try: Project structure -> Platform settings -> SDKs
Then add the path to the jdk.
After that got to Project under Project settings and select the project SDK.
I've worked with mint and intellij, and had no problems.

How to change project's java version in Intellij Idea?

I reinstalled java on my laptop with different version, and after that, my project can't run well in Intellij Idea. So I want to know how to change project's java version in Intellij Idea?
Make sure that the compiler correctly chose the version:
You need to go to Settings > Compiler > Java Compiler and update the Target bytecode version
Easier: press Shift twice and type Java Compiler and will lead you to that.
Setup the project SDK
Go to Project Structure > Project > Project SDK and add the link to the local Java file
File | Project Structure
Add your new SDKS, and chose right sdk for your Project.

IntelliJ IDEA Ultimate with Play Framework 2.6.7 Java imports 'symbol not resolved'

Be it an example project, freshly downloaded from Play Framework's website, or my project which is derived from that with a few changes to templates - nothing big - IntelliJ just can't seem to find the appropriate dependencies or sources necessary for Play development.
I've already installed Scala plugin for IntelliJ, which includes support for Play Framework. I'll outline the process that I've followed, after reading multiple articles from Play's documentation as well as questions asked on here though no answer has proven incredibly useful as yet.
Open Project Settings within IntelliJ IDEA Ultimate 2017.2.6
Click Modules > [+] > Import Module
Find build.sbt within project root
Import with default SBT settings:
Download: [checked] Library sources, [checked] SBT source
[unchecked] Use SBT shell for build and import (requires sbt 0.13.5+)
Project JDK: [9.0 (java version 9.0.1)] -- Could this be the problem? (compatibility)
SBT compiles and I get this error, which I somewhat dismissed but reading it now seems to be somewhat telltale but I am unsure of what: https://pastebin.com/tXbHQdek
Running the site works, using sbt run, but when opening .java sources, IntelliJ marks errors upon import play.mvc.* though import views.html.* works fine. Adding framework support for Play 2.x seems to do next to nothing, as no project settings seem to change, and the error is not resolved.
This behavior exists with a clean IntelliJ 2017 Ultimate install (as of today) and an example project from Play Framework with no modifications, so if a solution cannot be found I'll probably consider posting an issue on one or more of their issue trackers.
Any ideas on how to get my Play Framework development environment working?
Thanks :3
This did not originally occur to me but in my search through the Play Framework Google group, I found a suggestion on a somewhat recent post to uninstall Java 9 as Play's dependencies are not yet compatible with it and hence won't resolve.
For anyone who might come across this issue, hopefully this saves you some days headbanging:
Optional - Uninstall JDK and JRE 9
Install JDK 8 (comes with JRE)
From within IntelliJ, File > Project Structure > SDKs > [any Java 9 JDK] > [-]
[+] > `Find your JDK 8 installation folder
32 bit: C:/Program Files (x86)/Java/jdk****/
64 bit: C:/Program Files/Java/jdk****/
Where **** is your Java version, such as 1.8_152, as in jdk1.8_152
Press OK. You'll get a warning that the project SDK is missing or similar, so click the link it provides you to configure that and select your newly configured JDK.
Everything should work from there, just straight away after IntelliJ indexes, which can be tracked in the bottom right corner as with all other operation progress.

IntelliJ IDEA 12 Android slow response

When I type in the IntelliJ Editor I get major lags from multiple seconds, until my typed word gets displayed.
I'm running IntelliJ with Maven and Git to build Android Projects.
idea.exe, idea64.exe and idea.bat did produce the same issues.
My mistake was to apply the Android SDK in my Project settings.
Goto File | Project Structure | SDKs
Remove all Android related SDK's
Add only your default Java JDK like JDK 1.7 (default under: C:\Program Files\Java\)
Goto the Modules Tab
Apply the JDK to all modules or set ProjectSDK as it should now be the JDK1.7
As I tried to solve this problem for several days including adding the IDEA_JDK Variables
I thought sharing this solution could be helpful