Inspecting code on a non-java IntelliJ IDEA project
Answered
I'm using IntelliJ IDEA to build a non-java project, it is just a PHP + Javascript project, everything is working just fine but when I try to Inspect all the code in the project (Analyze -> Inspect Code) I get an error:
The JDK is not configured properly for this project. Inspection cannot proceed.
Am I doing something wrong? Do I have to configure an SDK even though the project is not java?
Note: The automatic code inspection for working files opened in the editor is working fine, the only problem is when I try to inspec all the code in the project.
Note 2: I cannot use PHPStorm neither Webstorm.
Thanks
Please sign in to leave a comment.
Does it help if you configure Java SDK for the project (not for the modules)?
I do not even have a java SDK installed, but I'll try and update this post.
Thank you for your help.
Yes, it works. Thanks.
But is this right? Do I need a Java SDK configured to inspect the code of a non-java project?
If your project has no Java modules, it seems to be a bug. Please report at https://youtrack.jetbrains.com/issues/IDEA and attach a small sample project to reproduce it.
Ok, I'll do thay, thank you very much for your help! :)
I recently ran into this problem where IntelliJ refuses to run Inspect Code on my (pure) Python project.
Please do report the possible solution(s) here.
---
IntelliJ IDEA 2018.3.4 (Community Edition)
Build #IC-183.5429.30, built on January 29, 2019
JRE: 1.8.0_152-release-1343-b26 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.2
Python 3.6.6 configured using PyEnv
Works fine on my machine. Could you please share project example for investigation?
My resolution was rather bizzare: when IntelliJ complained that JDK is not configured, in the following dialog box, I just selected JDK8 (instead of Python 3.7 path) and viola! its gone. Here's the link to my response on the related SO thread
You shouldn't get such a warning if there are no Java modules in project. Is it possible to provide an example for investigation?
Hey Yaroslav!
Here, please try this project: https://github.com/GIScience/openrouteservice-py
I'm currently optimizing their source code and now wanted to run inspections. With all these mentioned hacks like adjusting a JAVA_SDK to a WEB_SDK, i get other problems, e.g. bad indenting/general reformatting issues.
I am running IDEA 2018.2.5 Ultimate, here. (Gotta upgrade, yes)
Interestingly, i do edit many other projects, but this is the first one where i stumbled upon the problem :-)
I couldn't reproduce the issue with provided project in IDEA 2019. Please try to update your IDE.
I still have this problem with idea 2019.3.4. When I press "Analyze / Inspect Code" and "OK" in the dialog Idea says "The JDK is not configured properly for this project. Inspection cannot proceed.". Then when selecting a jdk the inspection starts indexing all java packages and finally gives me the inspection results. After that I have to go back to "Project Structure" settings to switch back from JDK to Python.
Even though I disabled the java inspection for the project Idea needs it =/
Do you use Java module with Python facet? Does it help if you make a project with the Python module instead?
Hey Serge, sorry but I don't really understand your question. There is no Java code in the project
Check the project structure, do you have the python icon for the module?
Serge Baranov The problem still exists for me in Intellij Idea Ultimate version 2020.1.2.
To your question: No the root icon with the project name does not have an Python icon but the configured interpreter is an Python icon (in your case its Django).
Im running on Ubuntu 20.04
Try to delete the module and add a new Python module instead: https://www.jetbrains.com/help/idea/creating-and-managing-modules.html#add-new-module .