Jump to content

intellij is unable to recognize class with class name Main (Main.java)


Recommended Posts

Posted (edited)

intellij is unable to recognize class with class name Main (Main.java)

 

If I edit a class name to Main (Main.java),

intellij shows it as broken file.

 

If I attempt to create new class called Main,

IntelliJ gives me a popup box:

"Unable to parse template “Class”
Error message: Selected class file name 'Main.java' mapped to not java file type 'XML' "

 

The main concern is that IntelliJ can't recognize old projects which consist of Main.java

 

I already tried to add this
"-Djdk.util.zip.ensureTrailingSlash=false" to
<IDE_HOME>\bin\idea64.exe.vmoptions (for the default 64-bit JVM)
and then  File -> Invalidate Caches/Restart

Still don't work

 

intellij think (Main.java) is XML file.

 

If I rename (Main.java) to any other name,

intellij is able to recognize it as class.

 

How to fix it?:feels:

Thanks:cate:

 

 

Edited by Pegasus

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...