指定的任务可执行位置“C:\程序文件(x86)\Java\jdk1.7.0_71\\bin\javac。exe”是无效的

时间:2021-03-12 16:03:10

Ok im wondering where does xamarin get this path from?

好,我想知道xamarin从哪里来的?

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.

严重程度代码描述项目文件线源抑制状态错误指定的任务可执行位置“C:\程序文件(x86)\Java\jdk1.7.0_71\\bin\javac。exe”是无效的。

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.

我可以把它改成新的jdk1.8。我有新的JDK设置,我只需要知道在哪里改变路径。

5 个解决方案

#1


7  

I had the same problem and solution is.

我有同样的问题和解决方法。

  1. Remove all jdk and install jdk 1.8
  2. 删除所有jdk并安装jdk 1.8。
  3. Change reference java location in Visual Studio Tool > Options > Xamarin
  4. 改变参考java位置在Visual Studio工具>选项> Xamarin。
  5. Clean and Rebuild Project
  6. 清洁和重建项目

#2


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.

我刚刚解决了这个问题。我不知道为什么你没有JDK_HOME变量。完全删除JDK并再次安装它?java的环境变量被设置为我之前安装的路径。我猜是Oracle搞砸了。

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.

我访问了c:java\,并检查了jdk文件夹的名称。对我来说,这是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.

对于不知道在哪里找到系统变量的用户:进入系统属性,在左边,点击高级系统设置。切换到高级选项卡,单击环境变量。在系统变量下,列表中应该有两个变量:JAVA_HOME和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.

我编辑了这些值,并更改了在java文件夹中找到的路径。对于我来说这将是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.

不需要关闭VS,只要构建你的应用程序,它应该会通过恼人的错误。

Hope this helps :)

希望这有助于:)

#3


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)).
  • 不要安装你所有的JAVA代码。删除两个JAVA文件夹(程序文件和程序文件(x86))。
  • Install the latest version of the Java (x32) SDK.
  • 安装最新版本的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.
  • 由于我的解决方案是多平台的,所以我将启动项目改为. ios one,构建它,在模拟器中运行它,并将启动项目设置为. droid项目。

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!

在这一切的某个地方,问题消失了。记住孩子!如果它可以自行消失,它可以自己再回来!

#4


0  

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

我也有这个问题,我下载了32位Java,但是VS仍然在寻找64位的。

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.

为了解决这个问题,我所要做的就是在我的路径中改变JAVA_HOME和变量,清理我的项目并重新构建它。

#5


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.

只需设置JAVA_HOME和JDK_HOME环境变量,清理解决方案并重新构建。我工作得很好。别忘了清洁你的解决方案。

#1


7  

I had the same problem and solution is.

我有同样的问题和解决方法。

  1. Remove all jdk and install jdk 1.8
  2. 删除所有jdk并安装jdk 1.8。
  3. Change reference java location in Visual Studio Tool > Options > Xamarin
  4. 改变参考java位置在Visual Studio工具>选项> Xamarin。
  5. Clean and Rebuild Project
  6. 清洁和重建项目

#2


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.

我刚刚解决了这个问题。我不知道为什么你没有JDK_HOME变量。完全删除JDK并再次安装它?java的环境变量被设置为我之前安装的路径。我猜是Oracle搞砸了。

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.

我访问了c:java\,并检查了jdk文件夹的名称。对我来说,这是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.

对于不知道在哪里找到系统变量的用户:进入系统属性,在左边,点击高级系统设置。切换到高级选项卡,单击环境变量。在系统变量下,列表中应该有两个变量:JAVA_HOME和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.

我编辑了这些值,并更改了在java文件夹中找到的路径。对于我来说这将是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.

不需要关闭VS,只要构建你的应用程序,它应该会通过恼人的错误。

Hope this helps :)

希望这有助于:)

#3


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)).
  • 不要安装你所有的JAVA代码。删除两个JAVA文件夹(程序文件和程序文件(x86))。
  • Install the latest version of the Java (x32) SDK.
  • 安装最新版本的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.
  • 由于我的解决方案是多平台的,所以我将启动项目改为. ios one,构建它,在模拟器中运行它,并将启动项目设置为. droid项目。

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!

在这一切的某个地方,问题消失了。记住孩子!如果它可以自行消失,它可以自己再回来!

#4


0  

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

我也有这个问题,我下载了32位Java,但是VS仍然在寻找64位的。

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.

为了解决这个问题,我所要做的就是在我的路径中改变JAVA_HOME和变量,清理我的项目并重新构建它。

#5


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.

只需设置JAVA_HOME和JDK_HOME环境变量,清理解决方案并重新构建。我工作得很好。别忘了清洁你的解决方案。