Bug 52588 - Current error "The previewer requires a 64bit version of Java ... https://java.com/en/download" for Forms Previewer with 32-bit JDK has incorrect download link and doesn't instruct the user to set the JDK in "Xamarin > Android Settings"
Summary: Current error "The previewer requires a 64bit version of Java ... https://jav...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Xamarin.Forms Previewer ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: High normal
Target Milestone: 4.3.0 (C9)
Assignee: Bugzilla
URL:
: 52174 ()
Depends on:
Blocks: 52589
  Show dependency tree
 
Reported: 2017-02-16 22:51 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2017-02-24 03:45 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: No
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2017-02-16 22:51:19 UTC
Current error "The previewer requires a 64bit version of Java ... https://java.com/en/download" for Forms Previewer with 32-bit JDK has incorrect download link and doesn't instruct the user to set the JDK in "Xamarin > Android Settings"




## Steps to replicate

1. Start with a Windows system that has a 32-bit version of the JDK installed and selected under "Tools > Options > Xamarin > Android Settings > Java Development Kit Location" in Visual Studio.

2. Create a new "Visual C# > Cross-Platform > Cross Platform App (Xamarin.Forms or Native) > Blank App, Xamarin.Forms, Shared Project".

3. Build the Android project.

4. Double-click the MainPage.xaml file to open it in the source editor.

5. Open "View > Other Windows > Forms Previewer"




## Results

An error dialog appears in the Forms Previewer window:

> Something went wrong
> 
> Unsupported version of Java detected
> 
> Details:
> 
> The previewer requires a 64bit version of Java. You can download a
> 64bit version from https://java.com/en/download.



## Issues with the current error message

- https://java.com/en/download is a link to the Java JRE download, not the Java JDK download.  Installing the JRE will not resolve this issue: the user must install the JDK.

- The message does not mention that the user must also ensure that the 64-bit JDK is selected under "Tools > Options > Xamarin > Android Settings > Java Development Kit Location".

- A smaller issue is that the wording of the message does not specifically discuss the possibility that the user might be running on 32-bit Windows.




## Suggested improvements

For the initial Cycle 9 general availability release, the quickest and simplest way to improve the messaging is just to change the Detail text.  The text might be more verbose than ideal for now for expediency.  Features to improve this error experience and simplify the text can be added in the future.


### Proposed new text

The previewer requires a 64-bit version of Oracle Java JDK 8 (1.8) or higher. Please install it and then set the Java Development Kit Location in the Tools->Options->Xamarin->Android Settings menu. Note that installing a 64-bit JDK requires 64-bit Windows (see also https://support.microsoft.com/help/827218).




## Testing environment info (brief)

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3

XamarinVS 4.3.0.738 (9473a85)

Java JDK 8u121 (1.8.0_121) (32-bit)

Windows 10 (64-bit) Version 1607 (OS Build 14393.321)
US English locale, US Eastern time zone
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2017-02-16 23:02:13 UTC
## Additional background context

This is a follow-up to non-public Bug 52174 to suggest some limited wording changes for the initial Cycle 9 general availability release (C9 target milestone).  I will file a follow-up bug right now for the "Features to improve this error experience and simplify the text can be added in the future" (for C9SR1 and later target milestones) and link that bug back to this one when it is ready.
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2017-02-16 23:24:17 UTC
I have now filed the follow-up Bug 52589 to track the additional changes for C9SR1 and later.
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2017-02-16 23:24:50 UTC
*** Bug 52174 has been marked as a duplicate of this bug. ***
Comment 5 xamarin-release-manager 2017-02-17 15:27:49 UTC
Fixed in version 4.3.0.776 (cycle9)

Author: Alan McGovern
Commit: ee7aec104fbf7ecbbfccc98a4e649aca11b8ce1b (xamarin/md-addins)
Included in Commit: 94b83e66995e3d84c67e9254d94ddf2895ac59e4 (xamarin/XamarinVS)
Comment 6 Alan McGovern 2017-02-17 15:31:17 UTC
Thanks Brendan!

I had to tweak the code to allow us to show the new windows-specific message only on windows. I also tweaked the mac message to give XS specific instructions too. People using XS on Windows will get a message with VS specific instructions, but there's nothing we can do about that since the correct mechanism for handling these errors has not been enabled yet.
Comment 7 Alan McGovern 2017-02-17 18:03:23 UTC
The updated commit does not compile against C9 because it's too old. It relies on changes that exist only in master
Comment 8 Alan McGovern 2017-02-17 18:04:16 UTC
I reverted the change. We'll deal with it after the first C9 release. There's no time for changes now.
Comment 9 Brendan Zagaeski (Xamarin Team, assistant) 2017-02-17 18:08:00 UTC
I can provide a pull request that is platform agnostic, removes the incorrect Java link, and just talk generally about settings the "JDK location in the IDE settings".

I'll have that ready shortly against the Cycle 9 branch of md-addins.
Comment 11 Luis Aguilera 2017-02-18 00:21:40 UTC
C9 is now closed. We'll move this bug to the next scheduled milestone, "15.1". We'll continue working on these issues, and will attempt to resolve them ASAP.
Comment 12 xamarin-release-manager 2017-02-18 01:17:57 UTC
Fixed in version 4.3.0.780 (cycle9)

Author: Brendan Zagaeski
Commit: e01ef1906056797d86f5c5ac1a7b6cf6b3fe0627 (xamarin/md-addins)
Included in Commit: 92fb549c1cc98ce52a11fb168aa60f105d160bea (xamarin/XamarinVS)
Comment 13 Brendan Zagaeski (Xamarin Team, assistant) 2017-02-24 03:45:38 UTC
## Verification status: verified fixed in the latest Cycle 9 version

GOOD: XamarinVS 4.3.0.784 (73f58d6)




## GOOD Results with XamarinVS 4.3.0.784 (73f58d6)

The message now avoids the inaccurate download link and mentions the requirement to set the Java JDK location in the IDE preferences:

> The previewer requires a 64-bit version of Oracle Java JDK 8 (1.8) or
> higher. Please install it and then set the Java JDK location in the
> Xamarin Studio or Visual Studio preferences.