7

Ok im wondering where does xamarin get this path from?

Severity Code Description Project File Line Source Suppression State Error The specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_71\\bin\javac.exe" is invalid.

So I can go and change it to the new jdk1.8. I have the new JDK set up I just need to know where to change the path at.

SkyWalker
  • 28,384
  • 14
  • 74
  • 132
SEng
  • 89
  • 2
  • 5
  • Have a look at your environment variables. For example, look at the PATH and JAVA_HOME. (Or reinstall Xamarin and let it pick it up, maybe...) – Jon Skeet Jul 13 '16 at 16:35
  • I have repaired Xamarin and reinstalled Java. the PATH enviroment variable goes to C:\ProgramData\Oracle\Java\javapath, I do not have a JAVA_HOME (or anything else using Java) – SEng Jul 13 '16 at 16:55
  • Please have a look for java home setup http://stackoverflow.com/questions/2619584/how-to-set-java-home-on-windows-7 – SkyWalker Jul 13 '16 at 16:58
  • I did still didnt work. the JAVA_HOME I created was C:\Program Files (x86)\Java\jdk1.8.0_92 – SEng Jul 13 '16 at 20:02

5 Answers5

7

I had the same problem and solution is.

  1. Remove all jdk and install jdk 1.8
  2. Change reference java location in Visual Studio Tool > Options > Xamarin
  3. Clean and Rebuild Project
Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Abelini
  • 71
  • 1
  • 5
1

I've just solved this exact problem for me. I don't know why you wouldn't have a JDK_HOME variable. Completely remove the JDK and install it again maybe? The Environment Variables for java were set to my previously installed path. I guess Oracle screwed up here.

As I had the same error, here's what I did:

I went to C:\Program Files\Java\ and checked what the jdk folder is called. For me it's jdk1.8.0_102.

For users who don't know where to find System Variables: Go to System Properties and on the left hand side, click Advanced System Settings. Switch to the Advanced tab, click Environment Variables. Under System Variables there should be two variables in the list called JAVA_HOME and JDK_HOME.

I edited those values and change the path to what I found in the java folder. In my case this would be C:\Program Files\Java\jdk1.8.0_102.

No need to close VS, just build your app and it should get passed the annoying error.

Hope this helps :)

DerpyNerd
  • 4,743
  • 7
  • 41
  • 92
0

I had exactly the same problem. I got it to go away (which is not the same thing as fixing it).

  • Un-install every bit of JAVA you have. Delete both JAVA folders (Program Files and Program Files (x86)).
  • Install the latest version of the Java (x32) SDK.
  • Clean and Rebuild your project(s).
  • Since my Solution is multi-platform, I changed the Startup Project to the .iOS one, built it, ran it in an emulator, and set the Startup Project back to the .Droid project.

Somewhere in all this, the problem went away. And remember kids! If it can go away all by itself, it can come back again all by itself!

LionelGoulet
  • 557
  • 2
  • 13
0

I had this issue as well, I downloaded 32 bit Java but VS was still looking for the 64 bit one.

To solve it all I had to do was change the JAVA_HOME and the variable in my Path, clean my project and rebuild it.

NinjaFocks
  • 335
  • 2
  • 15
0

Just set JAVA_HOME and JDK_HOME ambient variables, clean your solution and build again. For me worked fine. Don't forget to clean your solution.