Error during SonarScanner analysis

ERROR: Error during SonarScanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
        at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:85)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:74)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:70)
        at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:185)
        at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:123)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:73)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Fail to extract sonar-scanner-api-batch.jar
        at org.sonarsource.scanner.api.internal.JarExtractor.extractToTemp(JarExtractor.java:41)
        at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:52)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:76)
        ... 7 more
Caused by: java.nio.file.AccessDeniedException: C:\Users\jwy\AppData\Local\Temp\sonar-scanner-api-batch6763905247824743646.jar
        at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(Unknown Source)
        at java.base/java.nio.file.Files.newByteChannel(Unknown Source)
        at java.base/java.nio.file.Files.createFile(Unknown Source)
        at java.base/java.nio.file.TempFileHelper.create(Unknown Source)
        at java.base/java.nio.file.TempFileHelper.createTempFile(Unknown Source)
        at java.base/java.nio.file.Files.createTempFile(Unknown Source)
        at org.sonarsource.scanner.api.internal.JarExtractor.extractToTemp(JarExtractor.java:34)
        ... 9 more
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Hey @j_wy

Instead of dumping a stacktrace, please fill out the template for filing a good bug report.

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
  • steps to reproduce
  • potential workaround

P.S.: use the #bug:fault sub-category if you’re hitting a specific crash/error , or the #bug:fp sub-category for rules-related behaviour