英文:
Can't run Tomcat Server on VS code
问题
我无法在VS Code上运行Tomcat服务器。
错误消息如下所示:
[apache-tomcat-9.0.37]:'C:\Program'不被视为内部或外部命令,可操作的程序或批处理文件。
然而,我的Tomcat文件夹放在D盘,与源代码放在同一个文件夹中。
我不知道为什么它在尝试搜索“C:\Program”文件夹。
如果您能帮忙解决,我将不胜感激。
谢谢
jdk1.8
Windows10
VS code1.47.2
Tomcat9.0.37
英文:
I can't run Tomcat server on VS code.
The error message says below
[apache-tomcat-9.0.37]: 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
However my tomcat folder is put on D drive, same folder as source code.
I don't know why it's trying to search "C:\Program" folder.
I really appreciate it if you could help.
Thank you
jdk1.8
Windows10
VS code1.47.2
Tomcat9.0.37
答案1
得分: 5
我猜这在插件的最新版本中出现了问题。我遇到了类似的问题。现在我正在回退到一个两个月前的插件版本。这似乎可以工作。我很惊讶VS.Code会自动升级插件。
英文:
I guess this is broken in latest build of Plug In . I faced similar issue .Now I am reverting back to a plug in version which is 2 months old . This seems to work.
I was surprised that VS.Code automatically upgrades the plug in.
答案2
得分: 4
在我的这一方面,我发现这个扩展在启动之前会查找你的 settings.json 中指定的 "java.home" 路径,因此,注释掉该路径,错误就会解决。
英文:
On my side, I found that this extension looks your "java.home" path specified in your settings.json before it start, so commenting out the path and the error shall be solved.
答案3
得分: 2
我今天拿到了这个并且用以下方式'修复'了它:
C:\Progra~1\AdoptOpenJDK\jdk-11.0.7.10-hotspot\
对于Progra~1
,我只是省略了空格,这已经足够让事情正常运行。
英文:
I got this today and I 'fixed' it with
C:\\Progra~1\\AdoptOpenJDK\\jdk-11.0.7.10-hotspot\\
With Progra~1
I just omitted the whitespace, which was enough to get things running.
答案4
得分: 0
我在设置动态网页应用程序的VS Code时也遇到了相同的问题,我发现我们可以通过从VS Code的settings.json
中删除Java.home
变量来解决这个问题。你可以通过ctrl+shift+p搜索settings.json
来找到它。在你移除Java.home
变量后,VS Code将从环境变量中搜索默认的JAVA_HOME
变量,并运行Tomcat服务器。settings.json
我已经从设置中移除了JAVA_HOME
,对我有效如此。
英文:
I have also faced the same issue while setting up VS Code for a dynamic web app and I found that we can solve this issue by removing Java.home
variable from VS Code settings.json
. you can find it by ctrl+shift+p and search for settings.json
. After you remove Java.home
variable, VS Code will search for default JAVA_HOME
variable from environment variables and it runs Tomcat server. settings.json
I have removed JAVA_HOME from settings and it's working for me like this.
答案5
得分: -2
-
安装Java扩展包
-
在
setting.json
中"java.home" : "C:\\Program Files\\Java\\jdk1.8.0_261" 更改为 "java.home" : "C:\\Java\\jdk1.8.0_261"
英文:
-
install Java extenstion pack
-
In
setting.json
"java.home" : "C:\\Program Files\\Java\\jdk1.8.0_261" change to "java.home" : "C:\\Java\\jdk1.8.0_261"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论