16

Please help me, whenever I'm creating a new class in IntelliJ It give me a popup box cannot create class

I tried my directory marking it as 'Sources Root'(got from stackOverflow), but still I cannot resolve my problem.

Currently I'm using Linux(14.04, 64-bit)-OS. IntelliJ version-->Intellij IDEA 2017.1.3

I know my problem statements end's up in 2 lines..but this is the only what I could post Screenshort

Tensibai
  • 15,557
  • 1
  • 37
  • 57
Jack Sengar
  • 341
  • 1
  • 3
  • 9
  • Never seen such a thing from IntelliJ in the 13 years I've been using it. Did you do a clean install? – duffymo Aug 08 '17 at 20:32
  • try https://stackoverflow.com/questions/31374605/android-studio-unable-to-add-a-new-class-or-any-file-to-a-project – Oleg Aug 08 '17 at 20:41
  • 1
    duffymo yes, I reinstalled it twice – Jack Sengar Aug 08 '17 at 21:01
  • 2
    I had the same problem, and for whatever reason, the files that the IDE uses to define how to create a class, interface, singleton, etc., were missing. Look in the "C:\Users\YOURUSERID\.IntelliJIdea201X.X/config/fileTemplate‌​s/internal" directory, and if there are no files there, you need to add them. For the "Singleton.java" file, that does NOT reside inside of the 'internal' subdirectory, but in the 'fileTemplates' parent directory. If you don't have the files to copy back, you'll probably have to reinstall IJ, so that it generates those files. – Adrian Romanelli Aug 11 '17 at 00:51
  • 2
    finally I resolved my problem, by reinstalling it. – Jack Sengar Aug 11 '17 at 09:36
  • 10
    I don't get why it was closed as "unclear". This question is perfectly clear. Other closing reasons might apply though. – Denys Séguret Oct 19 '17 at 09:16
  • 1
    Stumbled over the same issue. Found a solution here (Fred comment worked for me) https://intellij-support.jetbrains.com/hc/en-us/community/posts/206922365-Unable-to-parse-template-Class-Error-message-This-template-did-not-produce-a-Java-class-or-an-interface-during-New-Java-Class – Seva Dec 08 '17 at 02:49
  • 2
    This question is perfectly clear, and should be re-opened; especially in light of the fact that this particular IntelliJ problem seems to happen to quite a few people. At least until JetBrains fix this, it's appropriate for Stack Overflow to have the answer to this (not just a link to a comment elsewhere). – Dawood ibn Kareem Mar 21 '18 at 01:48
  • Sort of solution - copy paste templates from Android Studio. Details in: https://stackoverflow.com/questions/45534524/unable-to-parse-template-class-error-whenever-i-try-to-open-a-new-java-class – DimXenon Jun 30 '18 at 07:44
  • SOLUTION: Run 32 bit edition Idea - all templates will be available. Copy it in x32, then paste it in template editor for x64 edition. – DimXenon Jul 04 '18 at 20:01
  • try to run IntelliJ Idea as administrator – yaghob abbasi Nov 09 '22 at 10:50

0 Answers0