# org.sonar.java.AnalysisException

**URL:** <https://community.sonarsource.com/t/org-sonar-java-analysisexception/48864>\
**Category:** SonarQube Server / Community Build\
**Created:** [August 28, 2021, 11:13am UTC](https://community.sonarsource.com/t/org-sonar-java-analysisexception/48864 "2021-08-28T11:13:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sridharm17](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sridharm17/32/25244_2.png) [@sridharm17](https://community.sonarsource.com/u/sridharm17)\
**Post date:** [August 28, 2021, 11:13am UTC](https://community.sonarsource.com/t/org-sonar-java-analysisexception/48864/1 "2021-08-28T11:13:03Z")

</div>

INFO: Scanner configuration file: C:\Users\yashumanu7\Downloads\sonar-scanner-cli-4.6.2.2472-windows\sonar-scanner-4.6.2.2472-windows\bin…\conf\sonar-scanner.properties  
INFO: Project root configuration file: NONE  
INFO: SonarScanner 4.6.2.2472  
INFO: Java 11.0.11 AdoptOpenJDK (64-bit)  
INFO: Windows Server 2019 10.0 amd64  
INFO: User cache: C:\Users\yashumanu7.sonar\cache  
INFO: Scanner configuration file: C:\Users\yashumanu7\Downloads\sonar-scanner-cli-4.6.2.2472-windows\sonar-scanner-4.6.2.2472-windows\bin…\conf\sonar-scanner.properties  
INFO: Project root configuration file: NONE  
INFO: Analyzing on SonarQube server 9.0.1  
INFO: Default locale: “en\_US”, source code encoding: “windows-1252” (analysis is platform dependent)  
INFO: Load global settings  
INFO: Load global settings (done) | time=141ms  
INFO: Server id: BF41A1F2-AXuHm5i8zJFUICoo\_hTV  
INFO: User cache: C:\Users\yashumanu7.sonar\cache  
INFO: Load/download plugins  
INFO: Load plugins index  
INFO: Load plugins index (done) | time=109ms  
INFO: Load/download plugins (done) | time=469ms  
INFO: Process project properties  
INFO: Process project properties (done) | time=0ms  
INFO: Execute project builders  
INFO: Execute project builders (done) | time=0ms  
INFO: Project key: p3  
INFO: Base dir: C:\Users\yashumanu7\Downloads\Strata-main\Strata-main  
INFO: Working dir: C:\Users\yashumanu7\Downloads\Strata-main\Strata-main.scannerwork  
INFO: Load project settings for component key: ‘p3’  
INFO: Load project settings for component key: ‘p3’ (done) | time=47ms  
INFO: Load quality profiles  
INFO: Load quality profiles (done) | time=156ms  
INFO: Load active rules  
INFO: Load active rules (done) | time=3042ms  
WARN: SCM provider autodetection failed. Please use “sonar.scm.provider” to define SCM of your project, or disable the SCM Sensor in the project settings.  
INFO: Indexing files…  
INFO: Project configuration:  
INFO: 3481 files indexed  
INFO: Quality profile for java: Sonar way  
INFO: Quality profile for web: Sonar way  
INFO: Quality profile for xml: Sonar way  
INFO: ------------- Run sensors on module p3  
INFO: Load metrics repository  
INFO: Load metrics repository (done) | time=63ms  
INFO: Sensor JavaSensor [java]  
INFO: Configured Java source version (sonar.java.source): none  
INFO: JavaClasspath initialization  
INFO: ------------------------------------------------------------------------  
INFO: EXECUTION FAILURE  
INFO: ------------------------------------------------------------------------  
INFO: Total time: 13.067s  
INFO: Final Memory: 13M/47M  
INFO: ------------------------------------------------------------------------  
ERROR: Error during SonarScanner execution  
org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.  
at org.sonar.java.classpath.ClasspathForMain.init(ClasspathForMain.java:75)  
at org.sonar.java.classpath.AbstractClasspath.getElements(AbstractClasspath.java:317)  
at org.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:169)  
at org.sonar.java.JavaFrontend.(JavaFrontend.java:80)  
at org.sonar.plugins.java.JavaSensor.execute(JavaSensor.java:108)  
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)  
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)  
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)  
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)  
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)  
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:79)  
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)  
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)  
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:382)  
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:378)  
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:347)  
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)  
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)  
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:136)  
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)  
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)  
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)  
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)  
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
at java.base/java.lang.reflect.Method.invoke(Unknown Source)  
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)  
at com.sun.proxy.$Proxy0.execute(Unknown Source)  
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)  
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)  
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)  
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)  
at org.sonarsource.scanner.cli.Main.main(Main.java:61)  
ERROR:  
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [August 30, 2021, 2:41pm UTC](https://community.sonarsource.com/t/org-sonar-java-analysisexception/48864/2 "2021-08-30T14:41:51Z")

</div>

Hey there.

The error seems pretty clear:

> [@sridharm17](#):
>
> ERROR: Error during SonarScanner execution  
> org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.

SonarQube needs the compiled classes in order to perform an analysis of Java code (yes, that means a full build).

Are you using a build tool like Maven/Ant/Gradle? There are [scanners](https://docs.sonarqube.org/latest/analysis/overview) specific to these build tools to help you start analyzing your code quickly (and accurately).

---

<div class="post-metadata">

**Author:** ![sridharm17](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sridharm17/32/25244_2.png) [@sridharm17](https://community.sonarsource.com/u/sridharm17)\
**Post date:** [August 30, 2021, 3:02pm UTC](https://community.sonarsource.com/t/org-sonar-java-analysisexception/48864/3 "2021-08-30T15:02:35Z")

</div>

Hi colin.  
Thanks for reply.

I got the entire project in a folder.I’m trying to perform a scan on that folder. And everything it contains is .java files.  
Is there any way to scan .java?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [August 30, 2021, 3:15pm UTC](https://community.sonarsource.com/t/org-sonar-java-analysisexception/48864/4 "2021-08-30T15:15:40Z")

</div>

Hey there

You will need to have actually compiled the code first (simply having a folder of `.java` files is not enough), and then supply the compiled classes to the `sonar.java.binaries` analysis parameter.

I would focus for now on making sure you know how to compile the code you’ve downloaded.

---

<div class="post-metadata">

**Author:** ![sridharm17](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sridharm17/32/25244_2.png) [@sridharm17](https://community.sonarsource.com/u/sridharm17)\
**Post date:** [August 30, 2021, 3:24pm UTC](https://community.sonarsource.com/t/org-sonar-java-analysisexception/48864/5 "2021-08-30T15:24:50Z")

</div>

I will try to compile them with help of our devs.

Thanks colin for help.
