Intellij thinks a Java project is a python project - how do I switch back?

Answered

I thought it would be a good idea to move a Python project I created in PyCharm into the same Intellij project where I have java code.  At some point, that messed up the java project.  I tried deleting ".idea" and the iml file but Intellij still thinks it's a Python project - external libraries are all Python related and when trying to create a new file it asks for what Python type

Is there a way to switch back to java?  The jdk is set properly

1
7 comments

Are you sure all the .iml files vere removed and you have created a new project with the Java module type?

Note that module type is stored in the .iml file.

0
Avatar
Permanently deleted user

Yeah, I have.  I just tried again to be sure and it still defaults to thinking it's Python.   I'll create a new project 

0

Don't delete the files when the project is open.

0

Hello, 

I am having the same issue. 

Any clues of how to solve without creating the project from scratch? 

Thanks

0

You may backup/remove .iml file only and reimport project.

0

I am also affected. I am not sure what you mean by “re-import”. I closed the project and opened again the pom.xml file, but the same error appears. And I do not want to delete (one more time) my .idea directory because I will lose all my DB-connection settings, and possible more.

 

I tried to invalidate caches and restart too. Closed and re-opened the project 10 times already. Cleaned maven and rebuilt maven. Nothing works. Java still thinks it is python. Class imports do not work and everything in my java files is marked as an error. The IDE is unusable in this state.

Can you please suggest a solution? This has happened multiple times and costs lots of time.

0

Please file a bug at https://youtrack.jetbrains.com/newIssue?project=IDEA and provide a sample project with the steps to reproduce the issue.

0

Please sign in to leave a comment.