vscode-tomcat
vscode-tomcat copied to clipboard
Spawn jar ENOENT error when try to debug/run on tomcat server
Met this issue from the very beginning I use the extension.
jar command runs very well on any console in Windows 10. But when I tried to Debug a war on tomcat server, or run a war on tomcat server. It just failed with Error: Spawn jar ENONET.
Repro steps:
- Add jdk/bin to the very end of Path
- Launch VSCode with Tomcat Extension
- Find a .war file, right-click Run on tomcat server
Expected: Successfully run the war file on tomcat server.
Actual: Error: Spawn jar ENOENT. And nothing continue.
The issue may be external to VSCode or NodeJS, but also file an issue to track it here.
I am experiencing the same issue on Windows 10. I am able to use the extension just fine with the same .war file when running Visual Studio on a Mac. For me it is only an issue on Windows 10
@persecond
Sorry to hear this. I may forgot to mention the fix: just the find the jdk environment variables in path and move it to the beginning, like top 5-10 is also ok.
The issue is external for the extension or even for VSCode. So I created it and mark the external for tracking.
I too working in windows 10 .
The issue got resolved . There should not be two path variable for system and user. If it is there, had the jdk/bin in both the path variable
Hi,
I am having the same issue but in Ubuntu. I have moved the bin folder of my JDK installation to the beginning of my path variables but it still fails:
echo $PATH /opt/java-jdk/jdk1.8.0_181/bin:/home/...
Could you please give me some advice on how to solve this ?
Thank you !
@trystan2k Hi, sorry the above solution does not work for Ubuntu.
@trystan2k I'm also in ubuntu (openJDK 8) and do not have this issue.
Can you type the following commands into your terminal
$ which java
Additionally, how did you go about installing java? The traditional
$ sudo apt install default-jdk
or a different way?
Hi @JustAnotherSoftwareDeveloper , I am using Oracle JDK 8. So I installed following the guide on this page *https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-18-04 - the part about Oracle JDK).
Could this be the problem, do you think ?
$ which java
/opt/java-jdk/jdk1.8.0_181/bin/java
Thanks !
I'm betting it is, but most likely not because anything inherently wrong with oracle JDK, but just something weird. vscode-tomcat is simply calling the 'jar -xvf something.war' command on the backend.
I'm assuming you've already ran
$ sudo update-alternatives --config jar
? If not, try keeping them at the same version
Additionally, would you mind trying switching back to openjdk-8 using the update-alternatives command and then trying to run tomcat? One idea I have is that there's a permission issue with one of the folders, and java pointing in the opt directory. If it works with openjdk-8 and not the oracle-JDK, it narrows the amount of things that could be wrong down quite a bit.
Hi @JustAnotherSoftwareDeveloper ,
I didn't have ran the update-alternatives and seems that this was the key. I ran it for jar, java, and javac and put all in the same value (in the first on, auto-mode) and it worked like a charm !!
Thanks a lot for your help!
I ran into the same issue, windows 10. Adding java home to my user environment variables resolved the issue (previously I only listed java in the system environment variables)