Unable to get JAVA_HOME from Visual Studio 2019 image

Rafael Mesquita's Avatar

Rafael Mesquita

29 Jun, 2019 05:16 PM

Hi Everyone,

I am working to deploy an .net core 2.2 application using Visual Studio 2019 image to build a solution, execute SonarCloud and run tests, everything was working fine.
Since June 24th I have received error when try to run this command: " dotnet-sonarscanner end /d:sonar.login="$env:SONAR_TOKEN" ", its has been thrown an error:

SonarScanner for MSBuild 4.6.2
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
Calling the SonarQube Scanner...
ERROR: JAVA_HOME exists but does not point to a valid Java home
       folder. No "\bin\java.exe" file can be found there.
dotnet-sonarscanner : The SonarQube Scanner did not complete successfully
At line:1 char:1
+ dotnet-sonarscanner end /d:sonar.login="$env:SONAR_TOKEN"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (The SonarQube S...te successfully:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
02:42:17.927 Post-processing failed. Exit code: 1
Command executed with exception: 02:42:17.927 Post-processing failed. Exit code: 1

Link to appveyor build with that error: https://ci.appveyor.com/project/rsmivb/lotteryapp/builds/25514740

It seems that some update on Visual Studio 2019 image might removed JAVA_HOME environment variable for some reason. I did research on net about that but I didn't find anything related.
I've attached appveyor.yml latest file from my project, a workaround applying JAVA_HOME in before_script step and it starting working fine again.

Is it possible to apply on Visual Studio 2019 image JAVA_HOME on environment variable as image default, same as before June 24th?

Thank you in advance.

  1. 1 Posted by Owen McDonnell on 01 Jul, 2019 07:05 PM

    Owen McDonnell's Avatar

    The VS2019 image development will resume next week.

    But perhaps in the meantime you can try on Visual Studio 2019 Preview image. I tried to run your build on it but of course it fails and sonarscanner command since i can't decrypt credentials.

  2. 2 Posted by Rafael Mesquita on 02 Jul, 2019 12:56 AM

    Rafael Mesquita's Avatar

    Hi Owen,

    I've changed image to Visual Studio 2019 preview as per your suggestion and it is working fine.
    sonnarscanner error is related that JAVA JRE is not installed on Visual Studio 2019 image.

    Thank you for your response.

  3. 3 Posted by Ilya Finkelshte... on 07 Jul, 2019 12:07 AM

    Ilya Finkelshteyn's Avatar

    Hi Rafael,

    Sorry for delay with reply. Please watch this GitHub issue https://github.com/appveyor/ci/issues/2961 related Java on Visual Studio 2019. We hope to update this image by the end of the next week.

    Ilya.

  4. 4 Posted by Rafael Mesquita on 07 Jul, 2019 12:33 AM

    Rafael Mesquita's Avatar

    Hi Ilya,

    Thank you for the update. I've downgrade to Visual Studio 2019 preview and
    I'll wait the image being updated.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • appveyor.yml 1.4 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

13 Dec, 2019 05:26 PM
13 Dec, 2019 11:28 AM
12 Dec, 2019 09:36 PM
12 Dec, 2019 09:25 PM
12 Dec, 2019 06:01 PM

 

11 Dec, 2019 11:29 PM
11 Dec, 2019 08:47 PM
11 Dec, 2019 01:39 PM
10 Dec, 2019 12:29 AM
09 Dec, 2019 05:35 AM
07 Dec, 2019 04:20 PM