gpt4 book ai didi

Unable to run Java program with vscode(无法使用vscode运行Java程序)

转载 作者:bug小助手 更新时间:2023-10-24 20:13:11 28 4
gpt4 key购买 nike



I have upgraded my Visual Studio Code to version details:


Version: 1.38.1 (user setup)

Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0

Date: 2019-09-11T13:35:15.005Z

Electron: 4.2.10

Chrome: 69.0.3497.128

Node.js: 10.11.0

V8: 6.9.427.31-electron.0

OS: Windows_NT x64 10.0.18362

我已将我的Visual Studio代码升级到版本详细信息:版本:1.38.1(用户设置)提交:b37e54c98e1a74ba89e03073e5a3761284e3ffb0日期:2019-09-11T13:35:15.005Z电子:4.2.10 Chrome:69.0.3497.128 Node.js:10.11.0 V8:6.9.427.31-Electron.0操作系统:Windows_NT x64 10.0.18362



Every time I run the simple HelloWorld program written in Java, vscode prompt the following error

每次运行用Java编写的简单HelloWorld程序时,vscode都会提示以下错误




Extension host terminated unexpectedly




I think some extension related to Debugger of Java is incompatible with the vscode version or it may be deprecated.

我认为一些与Java调试器相关的扩展与vscode版本不兼容,或者它可能已被弃用。



Problem



Any help will be appreciate,
Thanks

如有任何帮助,将不胜感激,谢谢


更多回答

Read code.visualstudio.com/docs/java/java-tutorial. It's very helpful for vscode + java

阅读code.visualstudio.com/docs/java/java-tutorial.这对vscode+Java非常有帮助

优秀答案推荐

Did you install jdk? Are you using visual studio code ? If yes then do this:

你安装JDK了吗?您使用的是Visual Studio代码吗?如果是,则执行以下操作:


Please install necessary extensions and add an extension that create a .class file to excecute that .java file or you can simply use cmd

请安装必要的扩展并添加创建.class文件的扩展名以执行该.Java文件,或者您可以简单地使用cmd


In cmd goto your file location and enter following

在cmd中,转到您的文件位置并输入以下内容



  1. javac filename.java (this creates a .class file) then enter

  2. java filename.java (you will see your output in cmd)


更多回答

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com