vscode-tomcat icon indicating copy to clipboard operation
vscode-tomcat copied to clipboard

Can't select different JVM to run Tomcat instance

Open antoniorodc opened this issue 6 years ago • 7 comments

I can't select a different JVM to run instance of Apache Tomcat. Allways run with same JVM that VSCode.

I need to run Tomcat with JVM 1.7

antoniorodc avatar Mar 15 '19 09:03 antoniorodc

I have the same problem as you. Seems it executes the "java" command directly to start tomcat instance in a process. There's no option to configure it. The only way is to change JVM environment variable external, which is annoying. Hope it can be fixed soon.... while it's 2020, there's no update yet.

oldmaspicyrabbit avatar Jan 03 '20 07:01 oldmaspicyrabbit

You could pull down PR #277 an build it yourself

orsolli avatar May 26 '20 06:05 orsolli

while #277 does help, I'd like to be able to select a specific JVM for tomcat separate from vscode-for-java extension. VSCode for Java requires java 11, but I want to run tomcat on java 8 for now.

Barbiero avatar Aug 18 '20 13:08 Barbiero

You can set the java.home to a lower java version, but I don't think you will be abel to debugg anyway

orsolli avatar Aug 18 '20 16:08 orsolli

You can set the java.home to a lower java version, but I don't think you will be abel to debugg anyway

No, I literally can't. Java Support for VSCode requires java 11, and it uses java.home to determine which JVM to use for itself.

IMO there should be a "tomcat.java.home" or similar property to determine the JVM for tomcat. It would also be useful when you want to test different JVMs(ie. OpenJ9 vs HotSpot, 11 vs 14, Amazon vs Oracle, etc) without changing the JVM used for the vscode-java extension.

edit: Alternatively, adding a way to determine the JVM by java version (the java.configuration.runtimes property) instead of using java.home would be good.

Barbiero avatar Aug 18 '20 19:08 Barbiero

Hi to all, I have the same problem. With the current configuration of the java runtimes "java.configuration.runtimes": [ { "name": "JavaSE-1.8", "path": "/usr/lib/jvm/jdk1.8.0_162", "default": true }, { "name": "JavaSE-11", "path": "/usr/lib/jvm/jdk-11.0.8", } ], "java.home": "/usr/lib/jvm/jdk-11.0.8",

I expected tomcat to use the DEFAULT jvm (jdk1.8.0_162), instead use java.home, but java.home needs 11 for the proper functioning of the vscode plugins.

How can I solve the problem?

Dario

dariolicci avatar Jan 05 '21 15:01 dariolicci

I downgrade from 0.11.3 at 0.11.2 version and tomcat work correctly, now tomcat use the JDK 1.8 that I set as default=true.

dariolicci avatar Jan 05 '21 18:01 dariolicci