亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在 .NET Core/Standard 中將 java.exe 作為預構建步驟運行失敗并顯示

在 .NET Core/Standard 中將 java.exe 作為預構建步驟運行失敗并顯示

C#
瀟瀟雨雨 2022-07-23 16:32:55
我正在嘗試將 java.exe 作為 C#-.NET Standard 2.0 項目中的預構建步驟運行。csproj 文件包含以下代碼段:<Target Name="Java" BeforeTargets="Build">    <Exec Command="c:\Windows\System32\java.exe"/></Target>(我簡化了用于測試的命令行。)文件 java.exe 存在于 c:\windows\system32 中,但構建失敗并出現錯誤代碼 9009:c:\Windows\System32\java.exe' is not recognized as an internal or external command,1>operable program or batch file.1>C:\workspace\Test.csproj(21,5): error MSB3073: The command "c:\Windows\System32\java.exe" exited with code 9009.1>Done building project "Test.csproj" -- FAILED.直接從命令行運行 java.exe 可以正常工作。
查看完整描述

1 回答

?
白衣染霜花

TA貢獻1796條經驗 獲得超10個贊

顯然,c:\windows\system32 被路由到另一個路徑,因為 Visual Studio 是一個 32 位應用程序。使用特殊別名“Sysnative”有效:

<Target Name="Java" BeforeTargets="Build">
    <Exec Command="c:\Windows\Sysnative\java.exe"/>
    </Target>

更多信息在這里。


查看完整回答
反對 回復 2022-07-23
  • 1 回答
  • 0 關注
  • 131 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號