DSM analysis fails with "No class files were found"

Answered

I have a project which is building fine and has a number of classes. I can perform all the different types of analysis but when I try to generate a DSM I get the "No class files were found".  I see some references to this from 2007 but that was for Ant builds which doesn't apply here.

Any ideas?

This can be easily reproduced with, for example, this project: https://github.com/alibaba/fastjson

 

 

 

0
14 comments

Can't reproduce in IntelliJ IDEA 2017.3.4:

0
Avatar
Permanently deleted user

Can you give the details of exactly what you did? I.e. what scope you used, whether you included test sources, etc, so I can try the exact same way? I've tried several ways so far and all failed.

I'm using the same version.

Scopes that fail: whole project, directory fastjson, custom scope "all places"

0

Used all the defaults:

0
Avatar
Permanently deleted user

Okay, but I assume you're experienced enough to know that "works on my machine" is not a solution.

 

Screen capture:

https://drive.google.com/file/d/1BghNHKFKdni8rtIfvNmMv1ftmbyo-pNC/view?usp=sharing

 

0

Does Build | Rebuild complete without errors? Any errors in idea.log: https://intellij-support.jetbrains.com/hc/articles/207241085?

What IntelliJ IDEA version is used?

Can you delete .idea directory, reimport the project from pom.xml and rebuild, then try again?

0
Avatar
Permanently deleted user

Version 2017.3.4

Rebuilding has no errors in the IDE:

Information:javac 7 was used to compile java sources
Information:2/12/18, 7:13 PM - Compilation completed successfully in 11s 623ms

The log shows:

2018-02-12 19:12:51,498 [2402321] INFO - ij.compiler.impl.CompileDriver - COMPILATION STARTED (BUILD PROCESS)
2018-02-12 19:12:52,621 [2403444] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /Users/gwheeler/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/173.4548.28/IntelliJ IDEA.app/Contents/lib/jps-launcher.jar:/Users/gwheeler/Library/Preferences/IntelliJIdea2017.3/jdks/jbsdk8u152b1136.5_osx_x64/jdk/Contents/Home/lib/tools.jar:/Users/gwheeler/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/173.4548.28/IntelliJ IDEA.app/Contents/lib/optimizedFileManager.jar
2018-02-12 19:12:52,677 [2403500] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2018-02-12 19:12:52,677 [2403500] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Defaulting to no-operation (NOP) logger implementation
2018-02-12 19:12:52,677 [2403500] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2018-02-12 19:13:03,091 [2413914] INFO - lij.compiler.impl.CompilerUtil - COMPILATION FINISHED (BUILD PROCESS); Errors: 0; warnings: 0 took 11623 ms: 0 min 11sec

I quit IntelliJ, deleted the .idea directory, restarted, rebuilt, and tried again, but get the same error.

 

 

0
Avatar
Permanently deleted user

If I change the Java version to 1.8 (in Project Structure - Project SDK) then it works.

0

For some reason no classes are compiled on your system. Notice that target/classes directory is empty. Also the messages says 0 warnings, while this project produces a plenty of compiler warnings.

Enable debug logging for build.log file and share the complete build.log file with debug info after performing rebuild: https://intellij-support.jetbrains.com/hc/articles/206869619.

See also https://intellij-support.jetbrains.com/hc/articles/207241085 for the info how to enable debug logging for build.log.

0

Thanks for the info, I've reported a bug at https://youtrack.jetbrains.com/v2/issue/IDEA-186575, please follow for updates. See https://intellij-support.jetbrains.com/hc/articles/207241135 if you are not familiar with YouTrack.

0
Avatar
Permanently deleted user

Did you manage to get a repro using Java 1.7? Or do you still need me to get build log files files?

0

Yes, I did reproduce it with 1.7.

0
Avatar
Permanently deleted user

Ok, thanks! I'm unblocked for now too.

0

Quick question, is this feature only available for java in that it's searching for java compiled *.class files?

I tried running on a kotlin project whole project directory scoped and got this message

No Classes Found
No class files were found for the specified source files.
DSM analysis can’t be performed.

0

It should work with kotlin classes as well. I could test it with a sample kotlin project. Do you see your compiled classes in the projects view? Do you see the same issue when trying with the whole project ? 
It would help if you could share a reproducer project and a screencast of the issue. You can upload it to https://uploads.jetbrains.com/.
 

0

Please sign in to leave a comment.