Error When Running Files Created From Template

Answered

Hello,

 

I have just started to learn Java and the IntelliJ IDEA platform. It seems whenever I create a new project using the "Create project from template" option, it is spitting back an error whenever I try to run the program. Even if I try to run nothing but the class all by itself. I did notice that the -classpath is missing in the Run window at the bottom, if I compare it to other projects created from scratch.

Here is the project I am getting the error with:

 

Here is a project that runs smoothly:

 

Like I said the only difference is creating it from the template or not:

I am running Windows 10, IntelliJ IDEA version 2019.3.4 (I just downloaded it so I assume it's the newest version) and I'm using Amazon Corretto JDK 11 (also just downloaded and installed):

I feel like I'm missing something simple here. I've tried to re-install IntelliJ IDEA twice now and it seems to work at first, then after a day or so I will run into this error again. 

0
4 comments

Do you have the out directory created? It looks like the project is not compiled.

Please share .idea/modules.xml file. Does it link to the valid .iml file? What's the iml file name referenced from modules.xml? Does this file exist?

0
Avatar
Permanently deleted user

I was under the impression that the out directory wasn't created in any new project until you've run the program for the first time. At which an out directory would automatically be created. Is that wrong? When I don't create a project using the "Create project from template" option and run it for the first time it creates the out directory automatically.

 

It is pointing to an unknown file named untitled104.iml whereas it should point to Test.iml. But I'm not quite sure exactly the right fileurl and filepath to enter in. If I'm understanding this from what your saying.It should point to the project .iml file?

 

0

Close the project and change untitled104.iml to Test.iml.

Resetting IDE config to default should fix the original issue.

We have a bug logged, but it's not clear how to reproduce the issue and why it starts to occur: https://youtrack.jetbrains.com/issue/IDEA-184561 .

 

0
Avatar
Permanently deleted user

Okay, I'll just apply the fix for the time being. Hopefully it gets resolved. If I find anything of note, I'll mention it there. Thanks.

0

Please sign in to leave a comment.