【问题标题】:Why I can't install Java Extension Pack in Visual Studio为什么我无法在 Visual Studio 中安装 Java 扩展包
【发布时间】:2020-12-19 17:53:02
【问题描述】:

为什么尝试在 VS 中安装 java 扩展包。我得到了这些错误

[2020-12-19 18:36:45.800] [renderer1] [error] ["validating: Corrupt ZIP: end of central directory record signature not found","    at U.downloadInstallableExtension (file:///C:/Users/hp/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:635:461)","    at async U.doInstallFromGallery (file:///C:/Users/hp/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:632:594)"]
[2020-12-19 18:36:45.880] [renderer1] [error] Corrupt ZIP: end of central directory record signature not found: validating: Corrupt ZIP: end of central directory record signature not found
    at U.downloadInstallableExtension (file:///C:/Users/hp/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:635:461)
    at async U.doInstallFromGallery (file:///C:/Users/hp/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:632:594)

我使用文件 .vsix 手动安装它并获得以下日志:

19/12/2020 18:38:15 - Microsoft VSIX Installer
19/12/2020 18:38:15 - -------------------------------------------
19/12/2020 18:38:15 - vsixinstaller.exe version:
19/12/2020 18:38:15 - 16.8.3036
19/12/2020 18:38:15 - -------------------------------------------
19/12/2020 18:38:15 - Command line parameters:
19/12/2020 18:38:15 - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\vscjava.vscode-java-pack-0.12.1.vsix
19/12/2020 18:38:15 - -------------------------------------------
19/12/2020 18:38:15 - Microsoft VSIX Installer
19/12/2020 18:38:15 - -------------------------------------------
19/12/2020 18:38:16 - Skipping product Microsoft.VisualStudio.Product.BuildTools (9d27c81e) since it does not support extensions
19/12/2020 18:38:16 - Initializing Install...
19/12/2020 18:38:17 - Détails de l'extension...
19/12/2020 18:38:17 -   Identifier         : vscode-java-pack
19/12/2020 18:38:17 -   Name               : Java Extension Pack
19/12/2020 18:38:17 -   Author             : vscjava
19/12/2020 18:38:17 -   Version            : 0.12.1
19/12/2020 18:38:17 -   Description        : Popular extensions for Java development and more.
19/12/2020 18:38:17 -   Locale             : en-US
19/12/2020 18:38:17 -   MoreInfoURL        : 
19/12/2020 18:38:17 -   InstalledByMSI     : False
19/12/2020 18:38:17 -   SupportedFrameworkVersionRange : [0.0,2147483647.2147483647]
19/12/2020 18:38:17 - 
19/12/2020 18:38:17 -   SignatureState     : Unsigned
19/12/2020 18:38:17 -   Produits pris en charge : 
19/12/2020 18:38:17 -       Microsoft.VisualStudio.Code
19/12/2020 18:38:17 -           Version : 
19/12/2020 18:38:17 - 
19/12/2020 18:38:17 -   Références         : 
19/12/2020 18:38:17 - Détails de la signature...
19/12/2020 18:38:17 -   Extension is not signed.
19/12/2020 18:38:17 - 
19/12/2020 18:38:17 - Recherche des produits applicables...
19/12/2020 18:38:17 - Produit installé trouvé - Emplacement global
19/12/2020 18:38:17 - VSIXInstaller.NoApplicableSKUsException: Une ou plusieurs extensions sont destinées à Visual Studio Code. Essayez de les installer dans Visual Studio Code.
   à VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
   à VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
   à VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported)
   à VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported)
   à VSIXInstaller.App.Initialize(Boolean isRepairSupported)
   à VSIXInstaller.App.Initialize()
   à System.Threading.Tasks.Task`1.InnerInvoke()
   à System.Threading.Tasks.Task.Execute()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

我曾尝试安装一些其他 Java 扩展,例如 Maven for Java,但在安装它们时也出现错误。

有什么建议吗?

【问题讨论】:

  • 你在网络代理后面吗?
  • 谢谢你的回答,我想你可能是对的。我已经更改了整个编辑器以尽快开始我的项目。我安装了 NetBeans。大多数情况下,该错误与您提到的内容有关。我记得我之前修改了一些网络的东西

标签: java visual-studio visual-studio-code


【解决方案1】:

您可以通过以下链接在 visual-studio-code 上安装 java: https://aka.ms/vscode-java-installer-win

如果您再次遇到任何错误,请在下方留言以帮助您

【讨论】:

    【解决方案2】:

    这是我在使用您的链接安装时遇到的错误

    [20:24:53] Configure Java Settings
    [20:24:54] Configure Java Settings ... [Completed]
    [20:24:54] Install Java Extensions
    [20:25:06] Installing extensions...
    Installing extension 'vscjava.vscode-java-pack' v0.12.1...
    [20:25:06] Error: (node:264) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    (node:264) UnhandledPromiseRejectionWarning: validating: Corrupt ZIP: end of central directory record signature not found
        at F.downloadInstallableExtension (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:279:461)
        at async F.doInstallFromGallery (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:276:594)
    (node:264) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
    (node:264) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    (node:264) UnhandledPromiseRejectionWarning: validating: Corrupt ZIP: end of central directory record signature not found
        at F.downloadInstallableExtension (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:279:461)
        at async F.doInstallFromGallery (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:276:594)
    (node:264) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
    Corrupt ZIP: end of central directory record signature not found
    Failed Installing Extensions: vscjava.vscode-java-pack
    (node:264) UnhandledPromiseRejectionWarning: validating: Corrupt ZIP: end of central directory record signature not found
        at F.downloadInstallableExtension (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:279:461)
        at async F.doInstallFromGallery (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:276:594)
    (node:264) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
    [20:25:06] Retry ... [1]
    [20:25:10] Installing extensions...
    Installing extension 'vscjava.vscode-java-pack' v0.12.1...
    [20:25:10] Error: (node:12728) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    (node:12728) UnhandledPromiseRejectionWarning: validating: Corrupt ZIP: end of central directory record signature not found
        at F.downloadInstallableExtension (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:279:461)
        at async F.doInstallFromGallery (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:276:594)
    (node:12728) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
    (node:12728) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    (node:12728) UnhandledPromiseRejectionWarning: validating: Corrupt ZIP: end of central directory record signature not found
        at F.downloadInstallableExtension (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:279:461)
        at async F.doInstallFromGallery (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:276:594)
    (node:12728) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
    (node:12728) UnhandledPromiseRejectionWarning: validating: Corrupt ZIP: end of central directory record signature not found
        at F.downloadInstallableExtension (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:279:461)
        at async F.doInstallFromGallery (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:276:594)
    (node:12728) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
    Corrupt ZIP: end of central directory record signature not found
    Failed Installing Extensions: vscjava.vscode-java-pack
    (node:12728) UnhandledPromiseRejectionWarning: validating: Corrupt ZIP: end of central directory record signature not found
        at F.downloadInstallableExtension (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:279:461)
        at async F.doInstallFromGallery (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:276:594)
    (node:12728) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 8)
    [20:25:10] Retry ... [2]
    [20:25:13] Installing extensions...
    Installing extension 'vscjava.vscode-java-pack' v0.12.1...
    [20:25:13] Error occurred
    [20:25:13] Error: Error: (node:988) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    (node:988) UnhandledPromiseRejectionWarning: validating: Corrupt ZIP: end of central directory record signature not found
        at F.downloadInstallableExtension (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:279:461)
        at async F.doInstallFromGallery (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:276:594)
    (node:988) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
    (node:988) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    (node:988) UnhandledPromiseRejectionWarning: validating: Corrupt ZIP: end of central directory record signature not found
        at F.downloadInstallableExtension (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:279:461)
        at async F.doInstallFromGallery (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:276:594)
    (node:988) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
    Corrupt ZIP: end of central directory record signature not found
    Failed Installing Extensions: vscjava.vscode-java-pack
    (node:988) UnhandledPromiseRejectionWarning: validating: Corrupt ZIP: end of central directory record signature not found
        at F.downloadInstallableExtension (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:279:461)
        at async F.doInstallFromGallery (C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:276:594)
    (node:988) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
    [20:25:13] Failed to install Java Extension Pack.
    

    【讨论】:

      【解决方案3】:

      你的操作系统是什么??

      此文件仅适用于 windows

      【讨论】:

      • 尝试重新安装vscode并再次安装包
      • 我还是一样的错误,我也卸载了我的杀毒软件,还是一样的错误
      【解决方案4】:

      Java on Visual Studio Code Update – November 2020 中,强烈建议安装扩展包或Coding Pack for Java 用于在VS Code 上进行Java 开发。 请按照上面的链接安装 Coding Pack for Java-Windows

      【讨论】:

        【解决方案5】:

        目前Java Extension Pack 可用于 Visual Studio Code,而不是 Visual Studio

        要在 Visual Studio Code 上启用 Java 支持,您可以手动:

        1. 安装 JDK(不是 JRE)11+。因为Language Support for Java 需要 JDK 11+ 才能自行启动。
        2. [可选] 在 VS Code 的设置中,将 java.home 指向 JDK 的主目录。 (如果它被JAVA_HOME 指向、包含在PATH 中或安装在默认位置,则会自动检测到。)

        或者如 @user14479250 所述,您可以简单地运行一体化安装程序,如果缺少,它将安装 VS Code、JDK 11 和 Java 扩展。

        【讨论】:

          猜你喜欢
          • 2022-01-25
          • 1970-01-01
          • 2019-09-04
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2022-11-08
          • 2012-04-11
          • 1970-01-01
          相关资源
          最近更新 更多