class not found error - no output directory being created on new projects

Answered

There are no compiler errors but the build process does not seem to be creating a class file and there is no output directory created

14 comments
Comment actions Permalink

This happens on all new projects.  I can go directly into the Run Configuration and see the the class Main is in red

1
Comment actions Permalink

I just created a project without selecting one of the two starting templates and all worked just fine.  

1
Comment actions Permalink

I'm facing the same issue - even with 2019.3 version.  The build long once again complains about 'untitled104'!  An 'out' directory does NOT get created, even compilation log says compile went fine.  This issue happens when I use a template.

If I do not use a template, then, things work fine!

1
Comment actions Permalink

Log files keep saying untitled104.iml doesn't exist.  Does  that help narrow things down?

0
Comment actions Permalink

The module is present but it includes no out directory where compiled class files are put. So on run I get a class not found error.  Seems that the build process does not generate a class file or puts it somewhere where it cant be found

0
Comment actions Permalink

Can't reproduce.

0
Comment actions Permalink

Which template do you use? Please upload the sample project at https://uploads.services.jetbrains.com/ and specify the file name here.

0
Comment actions Permalink

Serge Baranov, I have uploaded the project "test-app.zip".  In that zip is also (portion of) idea.log and build.log messages.  The template I used, which was the only one shown, is "Command line app".  In the project's .idea/modules.xml, I see a reference to "untitled104.iml".  The idea log has a couple of apparently error messages (shown as INFO, but also "stderr") one on SLF4J and another on com.google.protobuf.UnsafeUtil.  Any info on those?  Are they "harmless" or any specific settings needed to avoid them?

0
Comment actions Permalink

When you create a new project from command line template, it automatically creates a module with the name you've specified and the modules.xml file links with .iml file with the module name.

If I create untitled2 project, the following will appear:

As you can see, everything is consistent and the same file/module/project name is used.

It's not clear why you have untitled104.iml module in the project named test-app.

Reinstall the IDE, remove IDE folders (https://intellij-support.jetbrains.com/hc/articles/206544519), start with all the defaults and see if the issue persists.

0
Comment actions Permalink

Is JetBrains any closer to fixing this issue? It reproduces for me with 2019.3.4, so I upgraded to 2020.1 and it's still a problem there. Funny thing is, on my laptop, everything works. On my desktop, it's broken.

Prashanthr1776's post contains the important clue: using the JetBrains-supplied "command-line application" template makes a project that can't be built, and can't be reliably loaded. This is a pretty terrible user experience; I started with that template, did about an hour of work, then fell into a rat hole for more than two hours trying to debug the project  configuration and get the build to work.

 

0
Comment actions Permalink

OK, I'll meet you there.

0
Comment actions Permalink

No. Make sure module is present and content/source root are set correctly: https://www.jetbrains.com/help/idea/configuring-content-roots.html.

-1

Please sign in to leave a comment.