简体   繁体   中英

vs2019 - Xamarin: loses path settings of "Java Development Kit Location"

I do a very simple thing.

I go to Tools -> Options -> Xamarin> Android Settings and I change the "Java Development Kit Location" path. I press ok.

I compile the project and the option is used correctly.

I go to Tools -> Options -> Xamarin> Android Settings and the path is correct.

I restart VS, I go to Tools -> Options -> Xamarin> Android Settings and the path is wrong , it is the previous one.

Visual studio version used: Microsoft Visual Studio Community 2019 Version 16.11.7

happens to someone else?

is it a bug?

thanks

I faced a similar issue when updating visual studio 2019 from version 16.3 to 16.11 while working on a react native project, somehow my jdk installation got corrupted during or after installation. Initiating a repair it from the VS SDK manager did not work and I later found out that my jdk location was changed from:

C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.25

to

C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot

I updated the JAVA_HOME env variable to point to the new location then clean rebuild and everything is back to normal.

Hope this helps.

For the error with java development kit location, you could try the stpes below.

  1. Install the latest JDK 8 that's available from the Oracle Java SE Development Kit 8 Downloads webpage. https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2. Follow the instructions in the error message to manually point your Visual Studio instance to the location of your new JDK.

For the best mobile development experience, we encourage you to update to the latest Visual Studio version to keep up with the latest changes in iOS and Android development.

If you still want to use the old version and could not fix the error with the stpes above. You could try to repair the Visual Studio.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM