Using IntelliJ to compile Java 7, configuration trouble - intellij-idea

I am playing with IntelliJ and trying to get it to work with Java 7.
My JDK is set up to point to latest JDK
Additionally, project is set to use it as well
Yet, when trying to write Java7 code, it's syntax is not being recognized.
What am i missing please?

Set the Project Language Level to 7.0. Reload the project when asked:

Related

Problem in running a project with aspectJ in IntelliJ IDEA 2022.2.3 (Community Edition)

I am trying to run a project with aspectJ, rather than Java, in IntelliJ IDEA. I had done it before by simply putting "aspectj-1.9.6" in a "Lib" folder and setting the folder "as Library". But I tried it again today and it is not working. I think it might be because I have updated my IntelliJ to version "2022.2.3". I saw in this link that for intelliJ version "2021.1", one should select "ajc" as the project compiler in IntellJ. But it seems that there is no such compiler option in IntelliJ version "2022.2" (as I looked at this link and also searched in this link).
I also tried to install and enable "AspectJ weaver" plugin, but I encounter the following error: "Plugin 'AspectJ weaver' failed to initialize and will be disabled. Please restart IntelliJ IDEA.". Someone has had the same problem in this post, but the answer doesn't work for me, as it refers to this link, which is not compatible with IntelliJ version 2022.2.3:
So, I wonder whether aspectJ is not supported any more in IntelliJ?
Does any one has any suggestion that I could use it with this version of IntelliJ? I do really appreciate any help.
Thanks in advance
IntelliJ IDEA is compatible with AspectJ. I am running the plugin on 2022.2.3 without any problems. But I use IDEA Ultimate, you use Community. Did you notice this in your screenshot?
Compatible with IntelliJ IDEA Ultimate

cannot find symbol "var" in Intellij Idea

Whenever I try to run my application from Intellij Idea I get the following error..
If I build the application via Maven it works fine.
Take a look at my module settings the JDK is v10, the language is v10 as well for both the project and module.
Any idea why this would be happening?
I have no idea how this ever got set wrong but I had the Java compiler bytecode version settings set wrong in the IDE preferences...

Java 8 doesn't compile on Intellij15

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.

IntelliJ IDEA 14.03 failed to browse JDK 1.8 source code

I added the latest JDK 1.8 into my projects in IntelliJ IDEA 14.03. But later I found that I can't jump to the source code of any class from JDK. IntelliJ always using the internal java decompiler showing the source code decompiled from .class, even I manually disable the decompiler plugin!
When I switch back to Oracle JDK 1.7, everyting is fine.
Anyone has the same issue?
I am using MacOS 10.10.2(Yosemite)
I found the anwser. After "Invalid cache and restart", everything is working again.

IntelliJ 12 Grails 2.1 Configuration - Grails SDK not configured

I feel like I'm missing something simple at this point. I upgraded to grails 2.1.1 from 1.3.7 while running IntelliJ 10, recently I upgraded to IntelliJ 12 and imported all settings. Somehow in the project in IntelliJ 12, I have no grails SDK.
My Global Library has grails 2.1.1 defined with all the correct .jars included, however, the Tools menu is missing the "Grails" sub-menu, and attempting to run the app gives the error message that Grails SDK is not configured.
If I create a new project for grails, the SDK configures correctly and Grails shows in the Tools menu. What am I missing preventing me from adding the Grails SDK to this project? Thank you, community, for your time and suggestions.
You do not have to create a new project.
Had the same problem, and it took me quite some search to resolve it:
right click your Grails module
click "Add framework support"
select "Groovy"
The dropdown next to "Use library" will allow you to choose a grails library.
If the dropdown is empty press "create" and choose your grails library directory.
Grails SDK is configured then
With Intellij 16 right click on your project in the right hand project pane.
Choose Grails->Configure Grails SDK.
If you're using the grails wrapper I would point to that SDK:
/Users/your user/.grails/wrapper/2.5.2/grails-2.5.2
I have the IntelliJ 12 too, to run app i just click in 'File' -> 'Create Project', select 'Grails Project'
Click Next,
Click em Create, select the folder, who contain the Grails 2, and Voila. :-)
If you has the project before, run in project 'grails integrate-with --intellij' or run import project, and create a Grails SDK
I found a symlink that points to the latest version in:
~/.sdkman/candidates/grails/current
I'm using SDKMAN 4.0.37
Pointing Intellij at that location will allow you to switch versions using sdkman.
Not really an "answer" here, but after seeing similar troubles with IDEA I went ahead and just created a new project and copied my source in and resolved my issues, if not solving the actual problem.
I am working with IntelliJ 12.0.1 ultimate.
I have installed Grails 2.3.1 on my computer, but always got errors when trying to specify it as a Grails SDK-
"failed to create library. Looks like Grails distribution in specified path is broken. Cannot determine version."
I tried with Grails 2.3.0, but got the same error.
Then, I tried my luck with Grails 2.2.4, and I could finally get it work.
Creating a New Project will actually not overwrite any existing code; just point it at your existing project directory, select Grails and open it up.
Your project will now complain that there is no Grails SDK; just point it at your Grails dist and you are good to go.
Recently, I've encountered a similar type of issue. I have the grails SDK folder, but OK Button not enabled when trying to configure from the project. Then we have installed the Grails Plugin in IntelliJ. Then OK Button enabled and grails SDK is configured into project.